The Two Formulas (Memorise These First)
Usable hosts per subnet = 2h − 2 (where h = number of host bits)
Subtract 2 because the first address (network address) and last address (broadcast) cannot be assigned to hosts.
Number of subnets = 2s (where s = number of subnet bits borrowed from the host portion)
Example: /26 in a Class C (/24) network — you borrowed 2 bits for subnetting (26−24=2), so 2² = 4 subnets, each with 2⁶−2 = 62 usable hosts.
The Magic Number Method
The magic number is the block size of the subnet — how many IP addresses each subnet contains. Subnets always start at multiples of their block size. You never need to do binary conversion in your head once you know this method.
How to Find Any Subnet — 4 Steps
Example: /26 = 255.255.255.192 → 256 − 192 = 64
Example: /26 in 192.168.1.0 → 0, 64, 128, 192 (four subnets)
Example: Network 192.168.1.64 → next network is 192.168.1.128 → broadcast is 192.168.1.127
Example: Network .64, Broadcast .127 → Usable: 192.168.1.65 – 192.168.1.126
Complete CIDR Reference Table — /8 through /30
| CIDR | Subnet Mask | Magic # (Block) | Usable Hosts | Subnets from /24 | Exam Level |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | — | 16,777,214 | — | A+ |
| /16 | 255.255.0.0 | — | 65,534 | — | A+ |
| /24 | 255.255.255.0 | — | 254 | 1 | A+ |
| /25 | 255.255.255.128 | 128 | 126 | 2 | N+ |
| /26 | 255.255.255.192 | 64 | 62 | 4 | N+ |
| /27 | 255.255.255.224 | 32 | 30 | 8 | N+ |
| /28 | 255.255.255.240 | 16 | 14 | 16 | N+ |
| /29 | 255.255.255.248 | 8 | 6 | 32 | N+ |
| /30 | 255.255.255.252 | 4 | 2 | 64 | N+ |
| /31 | 255.255.255.254 | 2 | 0 (2 for P2P) | 128 | N+ |
| /32 | 255.255.255.255 | 1 | 1 (host route) | 256 | N+ |
The magic numbers for /25 through /30 are: 128 · 64 · 32 · 16 · 8 · 4. Each one is half the previous. If you forget the block size for a prefix, just start at 128 for /25 and halve it for each step: /25=128, /26=64, /27=32, /28=16, /29=8, /30=4.
/30 is the most important small subnet — 2 usable hosts, used for point-to-point WAN links between routers. The exam tests this frequently in router configuration scenarios.
Worked Examples — Step by Step
VLSM — Variable Length Subnet Masking
VLSM lets you use different subnet sizes within the same address space — so you're not wasting addresses by giving every department the same block size. Instead of one /24 = 8 equal /27 subnets, VLSM lets you give Sales a /25 (126 hosts), IT a /27 (30 hosts), and the WAN link a /30 (2 hosts). This is standard practice in real networks and is tested on Network+.
Always allocate the largest subnet first. Start with the department that needs the most hosts, assign the smallest prefix that fits, then work down to smaller subnets. This prevents address space fragmentation.
Example: Given 192.168.1.0/24, allocate: Sales (100 hosts) → IT (25 hosts) → Management (10 hosts) → WAN link (2 hosts).
| Dept | Hosts Needed | Subnet Used | Network Address | Broadcast | Usable Range |
|---|---|---|---|---|---|
| Sales | 100 | /25 (126 hosts) | 192.168.1.0 | 192.168.1.127 | .1 – .126 |
| IT | 25 | /27 (30 hosts) | 192.168.1.128 | 192.168.1.159 | .129 – .158 |
| Management | 10 | /28 (14 hosts) | 192.168.1.160 | 192.168.1.175 | .161 – .174 |
| WAN Link | 2 | /30 (2 hosts) | 192.168.1.176 | 192.168.1.179 | .177 – .178 |
Performance-Based Question (PBQ) Practice
HR (20 hosts): Needs /27 (30 hosts) → 10.10.10.64/27, usable .65–.94, broadcast .95
IT (12 hosts): Needs /28 (14 hosts) → 10.10.10.96/28, usable .97–.110, broadcast .111
WAN link: /30 → 10.10.10.112/30, usable .113–.114, broadcast .115
Remaining space: 10.10.10.116–10.10.10.255 is unallocated for future use.
Host A (.65) is in the 192.168.5.64/27 subnet (range: .65–.94, broadcast .95).
Host B (.100) is in the 192.168.5.96/27 subnet (range: .97–.126, broadcast .127).
They are on different subnets — even though they're on the same switch, they cannot communicate directly. Traffic must route through the default gateway. The issue is that the switch is not doing inter-VLAN routing, or the subnets are not both reachable via the gateway 192.168.5.1 (which is itself not in either subnet — that's also a configuration error).
Block size in the 3rd octet: /22 = 255.255.252.0 → 256 − 252 = 4 (blocks of 4 in 3rd octet).
Network 172.20.0.0 → next network is 172.20.4.0 → broadcast is 172.20.3.255.
Usable range: 172.20.0.1 – 172.20.3.254.
The network and broadcast addresses are not usable. A /26 has 64 addresses but only 62 usable hosts (subtract 2, always). Exam questions that give you "64 hosts" are testing whether you pick /26 (62 hosts — correct) or /25 (126 hosts — unnecessarily large).
/31 is a special case. Technically 2² − 2 = 0 usable hosts, but RFC 3021 permits /31 for point-to-point links because no broadcast is needed. The exam occasionally includes /31 — know that it's used for P2P links and has 2 assignable addresses.
Don't confuse subnets-from-/24 with total subnets. A /26 gives you 4 subnets when splitting a /24. But if you're splitting a /22, you get many more. Always read the question — it will tell you the parent block you're subnetting from.
Ready to pass Network+?
See the best courses, practice exams, and study guides for N10-009.
Why Subnetting Matters Beyond the Exam
Subnetting is the single most important practical skill in networking, not just an exam topic. Every network engineer, system administrator, and IT support professional who deals with TCP/IP networks needs to subnet. In the real world you subnet to: isolate network segments for security (VLANs + subnets keep the finance department's traffic separate from the guest Wi-Fi), design efficient address space allocation for a new office or cloud VPC, troubleshoot connectivity issues where hosts can't communicate because they're on different subnets, and configure firewall rules that apply to specific network ranges. Passing Network+ is the short-term goal; being able to subnet quickly in your head is the career-long payoff.
Subnetting Practice Problems — Work Through These
The only way to get fast at subnetting is repetition. Here are worked examples at increasing difficulty.
Problem 1 (basic): Given 192.168.5.0/24, divide into 4 equal subnets. You need 4 subnets from a /24. 2^2 = 4, so borrow 2 bits → /26. Block size: 256 − 192 = 64. Subnets: 192.168.5.0/26 (hosts .1–.62, broadcast .63), 192.168.5.64/26 (hosts .65–.126, broadcast .127), 192.168.5.128/26 (hosts .129–.190, broadcast .191), 192.168.5.192/26 (hosts .193–.254, broadcast .255). Each subnet has 62 usable hosts.
Problem 2 (exam style): A host has IP address 172.16.45.200/20. What is its network address? /20 means the first 20 bits are network. In the third octet, 20 − 16 = 4 bits are network bits. The subnet boundary in the third octet: 256/2^4 = 16. 45 ÷ 16 = 2 remainder 13. Network starts at 2×16 = 32. Network address: 172.16.32.0. Broadcast: 172.16.47.255. Host range: 172.16.32.1 – 172.16.47.254.
Problem 3 (VLSM): You have 10.0.0.0/24. Allocate subnets for: Engineering (100 hosts), Sales (50 hosts), Management (20 hosts), WAN link (2 hosts). Largest first: Engineering needs /25 (126 usable) → 10.0.0.0/25. Sales needs /26 (62 usable) → 10.0.0.128/26. Management needs /27 (30 usable) → 10.0.0.192/27. WAN link needs /30 (2 usable) → 10.0.0.224/30.
Common Subnetting Mistakes on the Exam
Forgetting the network and broadcast addresses. A /24 has 256 addresses but only 254 usable hosts — .0 is the network address, .255 is the broadcast. This is always 2 addresses lost per subnet, regardless of size. A /30 has 4 addresses: network (.0), two usable hosts (.1 and .2), and broadcast (.3). The minimum usable subnet is /30 for a point-to-point link needing exactly 2 hosts. (/31 is a special case for point-to-point links that eliminates the network/broadcast overhead, but this is rarely tested at A+/Network+ level.)
Miscounting subnets created. When the question asks "how many subnets does /26 create from a /24?", the answer is 4 (you borrowed 2 bits, 2^2 = 4). When it asks "how many /26 subnets exist in a /8?", that requires more care: a /8 has 2^(26−8) = 2^18 = 262,144 /26 subnets. Know which question is being asked.
CIDR notation confusion. /24 is the prefix length (the number of network bits), not the subnet mask. The subnet mask for /24 is 255.255.255.0. The subnet mask for /26 is 255.255.255.192 (because 11000000 in the fourth octet = 128+64 = 192). Practice converting between CIDR notation and dotted-decimal subnet masks until it's automatic.