Network, broadcast and host range in seconds

The block-size method

You don't need to convert whole addresses to binary. For a prefix that doesn't end on an octet boundary, only one octet is "interesting": the one where the mask isn't 255 or 0.

  1. Find the interesting octet and its mask value. For /26 that is the 4th octet, mask 192.
  2. Block size = 256 − mask value. 256 − 192 = 64.
  3. Subnets start at multiples of the block size: 0, 64, 128, 192.
  4. The address's subnet is the multiple just at or below it. The broadcast is one less than the next multiple.
  5. First host = network + 1. Last host = broadcast − 1.

Example 1: 192.168.1.77/26

Block size 64 → subnets .0, .64, .128, .192. 77 falls in the .64 block.

NetworkFirst hostLast hostBroadcastHosts
192.168.1.64192.168.1.65192.168.1.126192.168.1.12762

Example 2: 10.20.130.5/20

/20 = 255.255.240.0, so the interesting octet is the 3rd, mask 240, block size 16: 0, 16, 32 ... 128, 144. 130 falls in the 128 block. The 4th octet goes from 0 to 255 inside it.

NetworkFirst hostLast hostBroadcast
10.20.128.010.20.128.110.20.143.25410.20.143.255

Example 3: 172.16.5.201/30

/30 = mask 252, block size 4: ... 196, 200, 204. 201 is in the 200 block: network .200, hosts .201 and .202, broadcast .203. Two usable hosts: perfect for a link between two routers.

Your turn

These questions are generated at random, as many as you like. Aim for each one in under 30 seconds.

Tip: Check your answers with the router: show ip route shows the network address of every interface's subnet, and an invalid address (a network or broadcast address) is refused with % Bad mask.

HOME LABS COMMUNITY DASHBOARD