CCNA Starting Saturday, August 8 | 9:00 AM - 12:00 PM | Now $499 (reg. $699) | Free First Demo Class! Register now

All resources
Study Guide

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 position2^nBit position2^n
018256
129512
24101,024
38112,048
416124,096
532138,192
6641416,384
71281532,768
1665,536

2. Subnet Mask Table (the ten you'll see most)

CIDRMask# subnets in /24Hosts per subnetBlock size
/24255.255.255.01254256
/25255.255.255.1282126128
/26255.255.255.19246264
/27255.255.255.22483032
/28255.255.255.240161416
/29255.255.255.2483268
/30255.255.255.2526424
/31255.255.255.2541280 (point-to-point)2
/32255.255.255.2552561 (host route)1
/23255.255.254.0(supernet)510512

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:

NeedRound-upPrefixAllocationHosts
200256/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):

SubnetPrefixNetworkBroadcastHosts
200-host LAN/2410.0.0.010.0.0.255.1-.254
60-host LAN/2610.0.1.010.0.1.63.1-.62
28-host LAN/2710.0.1.6410.0.1.95.65-.94
2-host WAN/3010.0.1.9610.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)

BlockRangeCommon use
10.0.0.0/810.0.0.0 - 10.255.255.255Large enterprise
172.16.0.0/12172.16.0.0 - 172.31.255.255Medium
192.168.0.0/16192.168.0.0 - 192.168.255.255Home / SMB
169.254.0.0/16APIPA (link-local)DHCP-failed clients
127.0.0.0/8Loopbacklocalhost

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.