⚡ The Key Insight
Subnetting is not memorisation — it's a repeating pattern. Every subnet has a block size (how many addresses it contains), and subnets always start at multiples of that block size. Once you know the magic number for any prefix length, you can find any subnet's network address, broadcast address, and usable host range in under 30 seconds. That's the entire skill the exam tests.

The Two Formulas (Memorise These First)

The Only Two Formulas You Need

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

1
Find the magic number
Subtract the last non-255 octet of the subnet mask from 256. That's your block size (magic number).
Example: /26 = 255.255.255.192 → 256 − 192 = 64
2
List the network addresses
Start at 0, then add the magic number repeatedly. Each result is the start of the next subnet.
Example: /26 in 192.168.1.0 → 0, 64, 128, 192 (four subnets)
3
Find the broadcast address
The broadcast is one less than the next network address.
Example: Network 192.168.1.64 → next network is 192.168.1.128 → broadcast is 192.168.1.127
4
Find usable host range
First usable = network address + 1. Last usable = broadcast address − 1.
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
/8255.0.0.016,777,214A+
/16255.255.0.065,534A+
/24255.255.255.02541A+
/25255.255.255.1281281262N+
/26255.255.255.19264624N+
/27255.255.255.22432308N+
/28255.255.255.240161416N+
/29255.255.255.2488632N+
/30255.255.255.2524264N+
/31255.255.255.25420 (2 for P2P)128N+
/32255.255.255.25511 (host route)256N+
🎯 Memorise This Pattern — Magic Numbers Are Powers of 2

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

Example 1 — Find the subnet for a host IP
A+ Level
A host has IP 192.168.10.130/26. What is its network address, broadcast address, and usable host range?
1.
Find the magic number: /26 = 255.255.255.192 → 256 − 192 = 64
2.
List subnet starts in the 4th octet (multiples of 64): 0, 64, 128, 192
3.
Which subnet does .130 fall into? 128 ≤ 130 < 192 → it's in the 192.168.10.128 subnet
4.
Broadcast: next subnet starts at 192 → broadcast = 192.168.10.191
5.
Usable range: 192.168.10.129 – 192.168.10.190 (62 hosts)
Example 2 — Choose the right subnet size
Network+ Level
A department needs exactly 20 hosts on a single subnet from the 10.0.0.0/24 block. What is the smallest subnet that fits, and what CIDR notation does it use?
1.
Find the smallest power of 2 that satisfies: 2h − 2 ≥ 20 → 25 − 2 = 30 ✓ (24 − 2 = 14 ✗ too small)
2.
5 host bits needed → 32 − 5 = /27
3.
Subnet mask: /27 = 255.255.255.224 → magic number = 256 − 224 = 32
4.
First subnet: 10.0.0.0/27 → usable: 10.0.0.1 – 10.0.0.30, broadcast: 10.0.0.31
Example 3 — Point-to-point WAN link
Network+ Level
Two routers need to be connected via a serial WAN link. Only 2 IP addresses are needed (one per router interface). What is the most efficient subnet?
1.
Need exactly 2 usable hosts: 22 − 2 = 2 ✓ → 2 host bits
2.
CIDR: 32 − 2 = /30 → 255.255.255.252, magic number = 4
3.
/30 subnets: .0, .4, .8, .12, .16 … each with exactly 2 usable hosts
4.
Example subnet 10.0.0.0/30: Router A = 10.0.0.1, Router B = 10.0.0.2, Broadcast = 10.0.0.3
Example 4 — Identify the host's subnet from a given IP
Harder — PBQ Style
A network admin receives an alert that 172.16.50.200/27 is unreachable. What subnet is this host on? Can it communicate directly with 172.16.50.220?
1.
Magic number for /27: 255.255.255.224 → 256 − 224 = 32
2.
Subnet starts in 4th octet: 0, 32, 64, 96, 128, 160, 192, 224 — .200 falls in 192–223 subnet
3.
Network: 172.16.50.192/27 · Broadcast: 172.16.50.223 · Hosts: .193–.222
4.
Is .220 in the same subnet? 192 ≤ 220 ≤ 223 → Yes — .220 is in the same /27 subnet, so they can communicate directly without a router

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+.

VLSM — The Rule

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

PBQ Scenario 1 — Address Assignment
A network uses the address block 10.10.10.0/24. You need to create subnets for four departments: Finance (50 hosts), HR (20 hosts), IT (12 hosts), and a WAN link (2 hosts). Assign subnets using VLSM, allocating the largest first.
Finance (50 hosts): Needs /26 (62 hosts) → 10.10.10.0/26, usable .1–.62, broadcast .63
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.
PBQ Scenario 2 — Connectivity Troubleshooting
Host A (192.168.5.65/27) cannot reach Host B (192.168.5.100/27). Both are on the same physical switch. The default gateway is 192.168.5.1. What is the problem?
/27 has a magic number of 32. Subnet starts: 0, 32, 64, 96, 128...
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).
PBQ Scenario 3 — Subnet Identification from Route Table
A router shows a route: 172.20.0.0/22. How many usable hosts does this subnet support, and what is the broadcast address?
/22 spans the third octet. Host bits = 32 − 22 = 10. Usable hosts = 2¹⁰ − 2 = 1,022 hosts.
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.
🎯 Three Common Exam Traps in Subnetting Questions

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.

Best Network+ Resources →

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.

Related Articles