Subnetting Cheat Sheet for Beginners

The table, the one trick and the worked example you need to subnet without fear. Keep it open while you practise.

Subnetting scares most networking students, but it becomes easy once you know a few patterns.

Analogy: an IP network is like a street. The network part of the address is the street name and the host part is the house number. Subnetting divides one long street into several shorter streets, each with its own range of house numbers.

Key terms

  • Network address: the first address in a subnet. It names the subnet and can't be given to a device.
  • Broadcast address: the last address. It reaches every device in the subnet and can't be given to a device.
  • Usable hosts: every address in between.
  • Prefix (CIDR): the /number, showing how many bits belong to the network.

Cheat sheet

PrefixSubnet maskTotal addressesUsable hostsBlock size
/24255.255.255.0256254256
/25255.255.255.128128126128
/26255.255.255.192646264
/27255.255.255.224323032
/28255.255.255.240161416
/29255.255.255.248868
/30255.255.255.252424

Formulas: total addresses = 2(32 − prefix), and usable hosts = total − 2.

The block size trick

Block size = 256 − the last number in the mask that isn't 255. For /26 (255.255.255.192) the block size is 256 − 192 = 64, so subnets start every 64 addresses: .0, .64, .128 and .192.

Worked example

Split 192.168.10.0/24 into four /26 subnets:

SubnetNetworkFirst usableLast usableBroadcast
1192.168.10.0192.168.10.1192.168.10.62192.168.10.63
2192.168.10.64192.168.10.65192.168.10.126192.168.10.127
3192.168.10.128192.168.10.129192.168.10.190192.168.10.191
4192.168.10.192192.168.10.193192.168.10.254192.168.10.255

Choosing the right size

Pick the smallest subnet that fits your hosts, with some room to grow:

  • A link between two routers: /30 (2 hosts)
  • A small office of 20 devices: /27 (30 hosts)
  • An office of 50 devices: /26 (62 hosts)
  • An office of 200 devices: /24 (254 hosts)

Private address ranges

These ranges are reserved for internal networks and are not routed on the internet: 10.0.0.0/8, 172.16.0.0/12 (172.16.x.x to 172.31.x.x) and 192.168.0.0/16.

Practice questions

Try each one first, then click to see the answer.

1. How many usable hosts are in a /28?

14. A /28 has 16 addresses; subtract the network and broadcast addresses.

2. What is the subnet mask for /27?

255.255.255.224

3. Which subnet does 192.168.1.75/26 belong to?

192.168.1.64/26. With a block size of 64, subnets start at .0, .64, .128 and .192, and .75 falls between .64 and .127.

4. What is the broadcast address of 10.0.0.32/28?

10.0.0.47. The block size is 16, so the subnet runs from .32 to .47.

5. You need a subnet for 45 hosts. Which prefix?

/26, which gives 62 usable hosts. A /27 only gives 30.

6. Is 172.16.5.63 a valid host address in 172.16.5.0/26?

No. It is the broadcast address of that subnet.