Free resource · CCNA & Network+
Subnetting cheat sheet
Everything you need to subnet quickly on exam day, on one page: the CIDR table, the magic-number method, the special ranges examiners love, and the IPv6 prefixes worth memorising. Read it here, or get the printable PDF.
Get the one-page PDF
We'll email you the download link, plus occasional subnetting practice. Unsubscribe any time.
CIDR to subnet mask table
“Block size” is how far each subnet steps in the octet named next to it: the number the magic-number method below is built on.
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts | Block size |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 1 (1st octet) |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 1 (2nd octet) |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 (3rd octet) |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 (3rd octet) |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 (3rd octet) |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 (3rd octet) |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 (3rd octet) |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 (3rd octet) |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 (3rd octet) |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 (3rd octet) |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 128 (4th octet) |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 64 (4th octet) |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 32 (4th octet) |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 16 (4th octet) |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 8 (4th octet) |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | 4 (4th octet) |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2* | 2 (4th octet) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 1 (4th octet) |
* /31 on point-to-point links (RFC 3021) uses both addresses; there is no network or broadcast address.
The magic-number method
- 1Find the interesting octet: the one where the mask is not 255 or 0.
- 2Block size = 256 − the mask value in that octet (e.g. /27 → mask 224 → block 32).
- 3List the multiples of the block size in that octet: 0, 32, 64, 96…
- 4The network address is the multiple at or just below the host's value.
- 5The broadcast is the next multiple minus 1. Usable hosts sit between them.
Worked example
192.168.10.77/27
- /27 → mask 255.255.255.224, so the 4th octet is interesting.
- Block size = 256 − 224 = 32. Multiples: 0, 32, 64, 96…
- 77 falls between 64 and 96, so the network is 192.168.10.64.
- Broadcast = 96 − 1 → 192.168.10.95.
- Usable hosts: 192.168.10.65 to 192.168.10.94 (30 hosts).
Check your own with the subnet calculator.
Special ranges
| 10.0.0.0/8 | Private (RFC 1918) |
| 172.16.0.0/12 | Private (RFC 1918): 172.16.0.0 to 172.31.255.255 |
| 192.168.0.0/16 | Private (RFC 1918) |
| 100.64.0.0/10 | Carrier-grade NAT shared space (RFC 6598) |
| 127.0.0.0/8 | Loopback |
| 169.254.0.0/16 | Link-local / APIPA (no DHCP answer) |
| 224.0.0.0/4 | Multicast (Class D) |
| 0.0.0.0/0 | Default route |
Powers of two
2^0
1
2^1
2
2^2
4
2^3
8
2^4
16
2^5
32
2^6
64
2^7
128
2^8
256
2^9
512
2^10
1,024
2^11
2,048
2^12
4,096
Quick facts
- Usable hosts = 2^(host bits) − 2. The network and broadcast addresses are reserved.
- /30 gives 2 usable hosts, the classic point-to-point link size.
- /31 gives 2 usable addresses on point-to-point links (RFC 3021): no network or broadcast address.
- /32 is a single host, used for loopbacks and host routes.
- Wildcard mask = 255.255.255.255 − subnet mask. Used in Cisco ACLs and OSPF network statements.
- Subnets needed → borrow n bits where 2^n ≥ subnets. Hosts needed → keep h bits where 2^h − 2 ≥ hosts.
VLSM in four steps
- 1Sort the subnets from largest host requirement to smallest.
- 2Give each the smallest prefix whose usable hosts cover it (hosts + 2 ≤ 2^h).
- 3Allocate from the start of the range, largest first, each on its own block boundary.
- 4Point-to-point links last: /30 (or /31 where supported).
Try it with the VLSM calculator.
IPv6 prefixes to know
/64
Standard subnet size for LANs (SLAAC needs it)
fe80::/10
Link-local, on every IPv6 interface
fc00::/7
Unique local (fd00::/8 in practice), the private-range equivalent
2000::/3
Global unicast
ff00::/8
Multicast (there is no broadcast in IPv6)
::1/128
Loopback
Now test it
Reading the table is the easy part. Exam questions mix subnetting with routing and ACLs.