Subnetting Drills
Subnetting is arithmetic, and arithmetic becomes fast with ten minutes a day. This note is the method, then the drills, then the answers.
The method that scales to /30
You need three numbers: block size, network address, broadcast address.
- Block size = 256 − (the mask octet you are in). For /26 the mask octet is 224, so block size = 32.
- Networks start at multiples of the block size in the interesting octet.
- Broadcast = next network − 1.
- Usable hosts = broadcast − network − 1.
| Prefix | Mask octet | Block size | Usable |
|---|---|---|---|
| /25 | 128 | 128 | 126 |
| /26 | 192 | 64 | 62 |
| /27 | 224 | 32 | 30 |
| /28 | 240 | 16 | 14 |
| /29 | 248 | 8 | 6 |
| /30 | 252 | 4 | 2 |
| /31 | 254 | 2 | 2 (point-to-point, no broadcast) |
| /32 | 255 | 1 | 1 (host route) |
Memorise this table and most questions collapse into one subtraction.
Worked example, slowly
Which subnet is 192.168.10.77/27 in, and what are its bounds?
- /27 → mask 255.255.255.224 → block size 32.
- Multiples of 32: 0, 32, 64, 96.
- 77 falls between 64 and 96 → network 192.168.10.64.
- Broadcast = 96 − 1 = 95.
- Usable = 65–94 (30 addresses).
Drills
Answer before scrolling. Aim for under 20 seconds each.
- Network and broadcast for
10.0.5.130/25? - How many usable hosts in
/28? - Is
172.16.4.200/26in the same subnet as172.16.4.190/26? - Split
192.168.0.0/24into four equal subnets. List them. - Smallest prefix that holds 50 hosts?
- Smallest prefix that holds 500 hosts?
- Point-to-point link, minimal waste: which prefix?
203.0.113.0/24— network and broadcast of the 6th /28?- Two hosts,
10.1.1.10/24and10.1.2.10/24: same subnet? - Summarise
10.8.0.0/24through10.11.0.0/24into one prefix.
Answers
- Block 128 → network
10.0.5.128, broadcast10.0.5.255. - 16 − 2 = 14.
- Block 64 → 200 is in 192–255, 190 is in 128–191. Different subnets.
- /26 →
192.168.0.0,.64,.128,.192, each with 62 usable. - 50 hosts needs 6 host bits (62) → /26.
- 500 needs 9 host bits (510) → /23.
- /31 (RFC 3021), or /30 if the platform does not support /31.
- /28 block 16; networks at 0,16,32,48,64,80 → 6th is
203.0.113.80, broadcast.95. - No — /24 boundaries fall between 10.1.1.x and 10.1.2.x.
- 10.8.0.0/22 (covers 10.8.0.0–10.11.255.255).
The mistakes that matter in practice
| Mistake | Consequence |
|---|---|
| Gateway outside the host's subnet | Host ARPs for an address it cannot reach, or sends to the wrong next hop |
| /24 assumed when the mask is /25 | Half the hosts are unreachable and it looks intermittent |
| Two subnets with the same CIDR | Routing becomes ambiguous; one side is silently unreachable |
| Summarising wider than the addresses present | A blackhole for the gap |
| Forgetting the network and broadcast | Off-by-two in capacity planning, occasionally in DHCP scopes |
| Overlapping ranges across VPN/VPC | Blocks the tunnel entirely; requires renumbering |
IPv6, briefly
No broadcast, no NAT, and the arithmetic is hexadecimal. The equivalents:
- /64 — one subnet, always; SLAAC requires it.
- /56 — a typical site allocation (256 subnets).
- /48 — a typical organisation allocation (65,536 subnets).
- /127 — point-to-point links.
- Subnetting is on the fourth hextet boundary; you almost never subnet below /64.
The habit that transfers: think in prefix lengths and boundaries, not in dotted decimal.
Related Notes
- Addressing Subnetting CIDR — the reference tables
- Home Lab Setup — apply it to lab 1
- Route Selection And Metrics — longest prefix match
- Cloud Networking Patterns — why the plan matters more in cloud