Subnetting Cheat Sheet
For CCNA 200-301 candidates. One page. Print and keep on your desk while you study.
1. Powers of Two (memorize columns 0-8)
| Bit position | 2^n | Bit position | 2^n |
|---|---|---|---|
| 0 | 1 | 8 | 256 |
| 1 | 2 | 9 | 512 |
| 2 | 4 | 10 | 1,024 |
| 3 | 8 | 11 | 2,048 |
| 4 | 16 | 12 | 4,096 |
| 5 | 32 | 13 | 8,192 |
| 6 | 64 | 14 | 16,384 |
| 7 | 128 | 15 | 32,768 |
| 16 | 65,536 |
2. Subnet Mask Table (the ten you'll see most)
| CIDR | Mask | # subnets in /24 | Hosts per subnet | Block size |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 1 | 254 | 256 |
| /25 | 255.255.255.128 | 2 | 126 | 128 |
| /26 | 255.255.255.192 | 4 | 62 | 64 |
| /27 | 255.255.255.224 | 8 | 30 | 32 |
| /28 | 255.255.255.240 | 16 | 14 | 16 |
| /29 | 255.255.255.248 | 32 | 6 | 8 |
| /30 | 255.255.255.252 | 64 | 2 | 4 |
| /31 | 255.255.255.254 | 128 | 0 (point-to-point) | 2 |
| /32 | 255.255.255.255 | 256 | 1 (host route) | 1 |
| /23 | 255.255.254.0 | (supernet) | 510 | 512 |
3. Core Formulas
- Hosts per subnet = 2^h − 2 (where h = host bits = 32 − prefix)
- Subnets per network = 2^s (where s = subnet bits borrowed from the parent network)
- Block size = 256 − interesting octet of mask
- Wildcard mask = 255.255.255.255 − subnet mask (per octet)
4. Fast Method (do this in your head)
Given an IP + mask:
1. Find the interesting octet, the rightmost octet of the mask that is not 0 or 255 (e.g., /27 → 4th octet = 224). 2. Block size = 256 − interesting octet. So /27 → 256 − 224 = 32. 3. Subnet boundaries = multiples of the block size in the interesting octet (0, 32, 64, 96, 128, 160, 192, 224). 4. Find the subnet the host IP lives in: the largest multiple of the block size ≤ that host's interesting-octet value. 5. Network address = subnet boundary. 6. Broadcast = next subnet boundary − 1. 7. Usable range = network + 1 → broadcast − 1.
5. Worked Examples
Example A: 172.16.45.50 /26
- Interesting octet (4th) of mask: 192. Block size = 256 − 192 = 64.
- Boundaries: 0, 64, 128, 192.
- 50 falls into the 0 subnet.
- Network: 172.16.45.0 · Broadcast: 172.16.45.63 · Hosts: .1-.62.
Example B: 10.1.20.130 /27
- Interesting octet: 224. Block size = 32.
- Boundaries: 0, 32, 64, 96, 128, 160, 192, 224.
- 130 falls into the 128 subnet.
- Network: 10.1.20.128 · Broadcast: 10.1.20.159 · Hosts: .129-.158.
Example C: 192.168.5.200 /29
- Interesting octet: 248. Block size = 8.
- Boundaries: ..., 192, 200, 208, ...
- 200 falls into the 200 subnet (exactly on the boundary).
- Network: 192.168.5.200 · Broadcast: 192.168.5.207 · Hosts: .201-.206.
Example D: Point-to-point WAN: 10.10.10.0 /30
- Block size = 4. Subnets: .0, .4, .8, .12 ...
- For the .0 subnet: Network = .0 · Broadcast = .3 · Hosts = .1 and .2.
Example E: /25 split of 192.168.1.0/24
- Block size 128.
- 192.168.1.0/25 (hosts .1-.126, broadcast .127)
- 192.168.1.128/25 (hosts .129-.254, broadcast .255)
6. VLSM Design (allocate largest blocks first)
For a 200-host LAN + a 60-host LAN + a 28-host LAN + a 2-host WAN out of 10.0.0.0/24:
| Need | Round-up | Prefix | Allocation | Hosts |
|---|---|---|---|---|
| 200 | 256 | /24 | _too big for /24 source, restructure_ | , |
| , | , | , | _use a /23 parent or split LAN_ | , |
Realistic VLSM out of 10.0.0.0/23 (510 hosts available):
| Subnet | Prefix | Network | Broadcast | Hosts |
|---|---|---|---|---|
| 200-host LAN | /24 | 10.0.0.0 | 10.0.0.255 | .1-.254 |
| 60-host LAN | /26 | 10.0.1.0 | 10.0.1.63 | .1-.62 |
| 28-host LAN | /27 | 10.0.1.64 | 10.0.1.95 | .65-.94 |
| 2-host WAN | /30 | 10.0.1.96 | 10.0.1.99 | .97-.98 |
Rule of thumb: sort networks by size, biggest first, then walk through the address space.
7. Wildcard Masks (for ACLs)
Wildcard = inverse of subnet mask. For /27 (mask 255.255.255.224):
Wildcard = 0.0.0.31
Used in Cisco ACLs and OSPF network statements:
access-list 10 permit 192.168.5.32 0.0.0.31, matches 192.168.5.32-.63.
8. IPv4 Private Ranges (RFC 1918)
| Block | Range | Common use |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 - 10.255.255.255 | Large enterprise |
| 172.16.0.0/12 | 172.16.0.0 - 172.31.255.255 | Medium |
| 192.168.0.0/16 | 192.168.0.0 - 192.168.255.255 | Home / SMB |
| 169.254.0.0/16 | APIPA (link-local) | DHCP-failed clients |
| 127.0.0.0/8 | Loopback | localhost |
9. Common Mistakes to Avoid
- Confusing block size with number of hosts, block size includes network + broadcast.
- Forgetting that /31 has 0 usable hosts under RFC 3021 (still used for point-to-point WAN links).
- Mixing up subnet mask and wildcard mask in ACLs, they are inverses.
- Counting the broadcast address as a usable host.
_Authored by CISNET instructors. Print this page (Cmd/Ctrl + P → Save as PDF) for offline reference._
Use Cmd/Ctrl + P → Save as PDF for an offline copy.