Bootstrap FreeKB - Linux Fundamentals - Subnet Mask (cidr) cheat sheet
Linux Fundamentals - Subnet Mask (cidr) cheat sheet

Updated:   |  Linux Fundamentals articles

In every subnet, the first available IP address is used for the network address, and the last available IP address is used for the broadcast address. The remaining available IP addresses are used for the hosts in the subnet. For this reason, the number of useable IP addresses is the number of available IP addresses minus 2.

The three most commonly used prefixes are:

  • /8
  • /16
  • /24

Or like this

  • x.[0-255].[0-255].[0-255]/8
  • x.x.[0-255].[0-255]/16
  • x.x.x.[0-255]/24

With /8, the first item in the IP address is used for the subnet (typically 10.) and the last three items are used for the network IP (typically 10.0.0.0), broadcast IP (typically 10.255.255.255) and host machines.

With /16, the first two items in the IP address are used for the subnet (typically 172.16) and third and fourth items are used for the network IP (typically 172.16.0.0), broadcast IP (typically 172.16.255.255) and host machines.

With /24, the first three items in the IP address are used for the subnet (typically 192.168.0) and the fourth item is the range of IP addresses used for the network IP (typically 192.168.0.0), broadcast IP (typically 192.168.0.255), and host machines.

Subnet Mask Prefix Number of available IP addresses per subnet Network IP First Available IP Address Last Available IP Address Broadcast IP Number of subnets
255.255.255.255 /32 0         16,777,216
255.255.255.254 /31 2         8,388,608
255.255.255.252 /30 4         4,194,304
255.255.255.248 /29 8         2,097,152
255.255.255.240 /28 16         1,048,576
255.255.255.224 /27 32         524,288
255.255.255.192 /26 64         262,144
255.255.255.128 /25 128         131,072
255.255.255.0

10.0.0.0/24

192.168.0.0/24

256

10.0.0.0

192.168.0.0

10.0.0.1

192.168.0.1

10.0.0.254

192.168.0.254

10.0.0.255

192.168.0.255

65,536
255.255.254.0 /23 512         32,768
255.255.252.0 /22 1,024         16,384
255.255.248.0 /21 2,048         8,192
255.255.240.0 /20 4,096

172.31.0.0

172.31.16.0

172.31.32.0

172.31.0.1

172.31.16.1

172.31.32.1

172.31.15.254

172.31.31.254

172.31.47.254

172.31.15.255

172.31.31.255

172.31.47.255

4,096
255.255.224.0 /19 8,192         2,048
255.255.192.0 /18 16,384         1,024
255.255.128.0

10.0.0.0/17

192.168.0.0/17

32,768

10.0.0.0

192.168.0.0

10.0.0.1

192.168.0.1

10.0.127.254

192.168.127.254

10.0.127.255

192.168.127.255

512
255.255.0.0

10.0.0.0/16

172.16.0.0/16

192.168.0.0/16

65,536

10.0.0.0

172.16.0.0

192.168.0.0

10.0.0.1

172.16.0.1

192.168.0.1

10.0.255.254

172.16.255.254

192.168.255.254

10.0.255.255

172.16.255.255

192.168.255.255

256
255.254.0.0 /15 131,072         128
255.252.0.0 /14 262,144         64
255.248.0.0 /13 524,288         32
255.240.0.0 /12 1,048,576         16
255.224.0.0 /11 2,097,152         8
255.192.0.0 /10 4,194,304         4
255.128.0.0 /9 8,388,608         2
255.0.0.0

10.0.0.0/8

16,777,216

10.0.0.0

10.0.0.1

10.255.255.254

10.255.255.255

0

 

 

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 95a0ee in the box below so that we can be sure you are a human.