Subnetting questions punish hesitation. On the CCNA or Network+ you don't have time to write out 32 bits for every address, and you don't get a calculator. What you need is a method you can run in your head in a few seconds and trust.
The magic-number method is that method. Here it is, with worked examples and the mistakes we see most often in real practice data. The whole thing also fits on our one-page subnetting cheat sheet, which you can download as a PDF.
The method in five steps
- Find the interesting octet: the one where the subnet mask isn't 255 or 0.
- Work out the block size: 256 minus the mask value in that octet.
- List the multiples of the block size in that octet: 0, block, 2×block…
- The network address is the multiple at or just below the host's value in that octet.
- The broadcast address is the next multiple minus one. Usable hosts sit between the two.
That's it. The only thing to memorise is the mask values: 128, 192, 224, 240, 248, 252, 254, 255. They're just the bits filling up from the left.
Example 1: 192.168.10.77/27
- /27 means the mask is 255.255.255.224, so the 4th octet is interesting.
- Block size: 256 − 224 = 32. Multiples: 0, 32, 64, 96…
- 77 falls between 64 and 96, so the network is 192.168.10.64.
- Broadcast is 96 − 1, so 192.168.10.95.
- Usable hosts: 192.168.10.65 to 192.168.10.94, which is 30 hosts (2⁵ − 2).
Example 2: 172.16.5.10/23
This is the one that catches people, because the interesting octet moves.
- /23 means the mask is 255.255.254.0, so the 3rd octet is interesting.
- Block size: 256 − 254 = 2. Multiples in the 3rd octet: 0, 2, 4, 6…
- 5 falls between 4 and 6, so the network is 172.16.4.0.
- Broadcast: the next block starts at 172.16.6.0, so the broadcast is 172.16.5.255.
So 172.16.6.20 is not on the same network as 172.16.5.10/23, even though it looks close. In our CCNA data report, every learner who got that question wrong made exactly that assumption.
Example 3: 10.1.1.34/30
- /30 means mask 255.255.255.252, block size 4: 0, 4, 8… 32, 36.
- 34 sits in 32–35: network 10.1.1.32, broadcast 10.1.1.35, usable .33 and .34.
The two mistakes that cost the most marks
Looking at thousands of real practice answers, two errors dominate.
Taking the next boundary as the broadcast. On the /30 question above, 86% of wrong answers were 10.1.1.36. That's the next subnet's network address. The broadcast is always the next boundary minus one. Say "minus one" out loud if you have to.
Using the wrong block size. On a /27 question (10.24.7.158/27), 73% of wrong answers were .191, the broadcast for a /26. People spotted that .158 was "in the top half" and stopped thinking. Recalculate the block size from the prefix every single time; it takes two seconds.
Two quick checks before you commit
- Is the network address a multiple of the block size? If not, you've placed the host in the wrong block.
- Are the network and broadcast exactly one block apart, minus one? For a /27, broadcast − network should be 31.
Practise until it's boring
The method only helps if it's automatic by exam day. Do a handful of addresses by hand, then check yourself with the subnet calculator, which shows the binary so you can see exactly where you went wrong. When you're getting them right without thinking, mix subnetting back in with everything else in a 30-question CCNA practice set or a Network+ set, because that's how it appears on the real exam.