How do you quickly subnet for certification exams?
The fastest exam subnetting method uses the "magic number" (256 minus the subnet mask octet). For /26, the mask is 255.255.255.192: 256-192=64, so subnets increment by 64: 0, 64, 128, 192. For any IP, find which block it falls in to identify the network address. Practice this method until you can subnet any CIDR notation in under 30 seconds without a calculator.
Subnetting is the most consistently tested technical skill on networking and cloud certifications. It appears on CompTIA Network+, CompTIA Security+, Cisco CCNA, AWS certifications, and Azure administrator exams. Candidates who cannot subnet fluently consistently report running out of time on exams, even when they understand every other concept.
The goal of this cheat sheet is not just to provide reference tables but to teach the subnetting calculation method that allows you to solve any subnetting problem quickly during an exam without relying on memorized tables.
The Subnet Mask to CIDR Reference Table
| CIDR | Subnet Mask | Wildcard Mask | Subnets from /24 | Hosts per Subnet |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 1 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 2 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 4 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 8 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 32 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 64 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 128 | 0 (point-to-point) |
| /32 | 255.255.255.255 | 0.0.0.0 | 256 | 1 (single host) |
Hosts per subnet formula: 2^(32 - prefix) - 2
The -2 accounts for network address (all zeros) and broadcast address (all ones).
The Magic Number Method
The magic number is the key to fast subnetting without binary conversion.
Step 1: Find the interesting octet (where subnetting occurs) Step 2: Calculate magic number = 256 - subnet mask value in that octet Step 3: Count by the magic number to find subnet boundaries
Example 1: What subnet does 192.168.1.130/26 belong to?
- /26 = 255.255.255.192
- Interesting octet = 4th
- Magic number = 256 - 192 = 64
- Subnets: 0, 64, 128, 192
- 130 falls between 128 and 192, so network = 192.168.1.128
- Broadcast = 192.168.1.191 (next subnet start - 1)
- Host range = 192.168.1.129 to 192.168.1.190
Example 2: What subnet does 172.16.10.73/27 belong to?
- /27 = 255.255.255.224
- Magic number = 256 - 224 = 32
- Subnets: 0, 32, 64, 96, 128, 160, 192, 224
- 73 falls between 64 and 96, so network = 172.16.10.64
- Broadcast = 172.16.10.95
- Host range = 172.16.10.65 to 172.16.10.94
"Do not memorize subnetting tables. Learn the magic number method so you can derive any answer from first principles. Tables fail when the exam presents an unusual prefix or a subnet within a larger network that the table does not cover." -- CCNA instructor guidance
Class-Based Address Ranges (Still Tested on Exams)
| Class | Range | Default Mask | Private Ranges |
|---|---|---|---|
| A | 1.0.0.0 - 126.255.255.255 | /8 | 10.0.0.0 - 10.255.255.255 |
| B | 128.0.0.0 - 191.255.255.255 | /16 | 172.16.0.0 - 172.31.255.255 |
| C | 192.0.0.0 - 223.255.255.255 | /24 | 192.168.0.0 - 192.168.255.255 |
| D | 224.0.0.0 - 239.255.255.255 | N/A (multicast) | N/A |
| E | 240.0.0.0 - 255.255.255.255 | N/A (reserved) | N/A |
Special addresses:
- 127.0.0.0/8 -- Loopback (127.0.0.1 is most common)
- 169.254.0.0/16 -- APIPA (Automatic Private IP Addressing, used when DHCP fails)
- 0.0.0.0 -- This network, all hosts
- 255.255.255.255 -- Limited broadcast (not routed)
VLSM (Variable Length Subnet Masking)
VLSM allows different subnets within the same network to have different sizes. This is tested on CCNA and Network+ exams.
VLSM example: Divide 192.168.1.0/24 for:
- LAN A: 100 hosts needed
- LAN B: 50 hosts needed
- LAN C: 25 hosts needed
- WAN link: 2 hosts needed
Solution:
- LAN A: 192.168.1.0/25 (126 hosts available) -- satisfies 100 requirement
- LAN B: 192.168.1.128/26 (62 hosts available) -- satisfies 50 requirement
- LAN C: 192.168.1.192/27 (30 hosts available) -- satisfies 25 requirement
- WAN: 192.168.1.224/30 (2 hosts available) -- satisfies 2 requirement
- Remaining: 192.168.1.228/30 through 192.168.1.252/30 available
VLSM rule: Assign subnets from largest to smallest to avoid waste and overlap.
IPv6 Quick Reference
IPv6 subnetting is also tested on CCNA and Network+ exams:
| Prefix | Common Use |
|---|---|
| /128 | Single host address |
| /64 | Standard LAN subnet (EUI-64 addressing) |
| /48 | Site prefix (typical ISP allocation per organization) |
| /32 | ISP assignment prefix |
| ::1/128 | IPv6 loopback |
| fe80::/10 | Link-local addresses |
| fc00::/7 | Unique local addresses (private IPv6) |
| ff00::/8 | Multicast |
| 2000::/3 | Global unicast (routable on internet) |
IPv6 address compression rules:
- Remove leading zeros in each group: 0045 = 45
- Replace one or more consecutive all-zero groups with :: (only once per address)
- Full address: 2001:0db8:0000:0000:0000:0000:0000:0001
- Compressed: 2001:db8::1
Subnetting Practice Problems
Use these to test recall without tools:
- What is the broadcast address of 10.0.0.50/27?
- How many hosts can be assigned in a /29 network?
- What subnet does 192.168.5.200/26 belong to?
- What is the first usable host in 172.16.100.0/25?
- How many /28 subnets can you carve from a /24?
Answers:
- 10.0.0.63 (subnet is 10.0.0.32, magic number 32, next subnet 10.0.0.64, broadcast is 10.0.0.63)
- 6 hosts (2^3 - 2 = 6)
- 192.168.5.192 (magic number 64, blocks: 0, 64, 128, 192; 200 falls in the 192 block)
- 172.16.100.1 (network 172.16.100.0, first host is .1)
- 16 subnets (2^4 = 16; /28 borrows 4 bits from a /24)
"Subnetting is a physical skill like touch typing. Reading about it does not build fluency. Only repetitive practice under time pressure, aiming for 30 seconds per problem, builds the speed that exam conditions require." -- Network+ and CCNA instructor consensus
Frequently Asked Questions
How long does it take to become fluent at subnetting? With daily practice of 10-15 subnetting problems, most candidates develop exam-level speed in 2 to 4 weeks. The goal is to solve any /24 through /30 problem in under 30 seconds. Practice daily with tools like SubnettingPractice.com or by generating random problems with a CIDR notation flashcard deck.
Does IPv6 subnetting appear heavily on certification exams? IPv6 appears on CCNA, Network+, and some cloud certification exams, but the subnetting questions are typically more conceptual than the detailed binary calculation required for IPv4. Most IPv6 exam questions test address type recognition (link-local vs. global unicast vs. unique local) and address compression rules rather than complex subnet calculations.
What subnetting mistakes do exam candidates most often make? The most common mistakes are: forgetting to subtract 2 from host counts (network and broadcast addresses are not assignable), confusing network address with first usable host, and making arithmetic errors in magic number calculation. Practice until these are automatic.
References
- CompTIA. (2024). CompTIA Network+ N10-009 Exam Objectives. https://www.comptia.org/certifications/network
- Cisco Systems. (2024). CCNA 200-301 Exam Topics -- IP Connectivity. https://learningnetwork.cisco.com/s/ccna-exam-topics
- Lammle, T. (2020). CompTIA Network+ Study Guide: Exam N10-008. Sybex/Wiley. Chapter 3: Subnetting and VLSM.
- Odom, W. (2020). CCNA 200-301 Official Cert Guide, Volume 1. Cisco Press. Chapters 11-14: IPv4 Addressing.
- Internet Engineering Task Force. (2006). IPv6 Addressing Architecture (RFC 4291). https://www.rfc-editor.org/rfc/rfc4291
- SubnettingPractice.com. (2024). Free IPv4 Subnetting Practice Tool. https://subnettingpractice.com/
