Subnetting in your head — the 5-step method
A repeatable five-step recipe that gives you the network address, broadcast address, usable range, and number of hosts for any IPv4 address and mask in under 30 seconds. Worked examples included.
What you'll learn
- Find the network and broadcast for any IP/mask combination.
- Count usable hosts and list the first/last usable IP.
- Apply the method quickly against a practice set.
The recipe
- Step 1 — write down the prefix and the matching dotted-decimal mask. Given a dotted mask instead, count its 1 bits to get the prefix.
- Step 2 — find the interesting octet (the one that isn't all 255 or all 0).
- Step 3 — compute the magic number: 256 minus the interesting octet's mask value. That is the block size.
- Step 4 — find the largest multiple of the magic number that is ≤ the IP's interesting octet. That value goes in the interesting octet of the network address; octets to its left are copied from the IP, and octets to its right become 0.
- Step 5 — broadcast: the interesting octet is that multiple + magic number − 1, and every octet to its right is 255. First usable = network + 1 and last usable = broadcast − 1, both in the last octet. Hosts = 2^h − 2.
Worked example #1 — 192.168.10.42 /27
Mask 255.255.255.224. Interesting octet = 4 (value 224). Magic number = 256 − 224 = 32. Largest multiple of 32 ≤ 42 is 32. Network = 192.168.10.32. Broadcast = 192.168.10.32 + 32 − 1 = 192.168.10.63. Usable = .33 through .62. That is 30 hosts.
8 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time
Build it step by step
- Subnetting drill on the canvasSubnet 192.168.1.0/24 into four /26s on four router ports, put a PC in each, and prove every /26 is its own broadcast domain. · 6 steps · ~22 min · 9 devices
- VLSM for two sitesCarve one /24 into a /26, a /27 and a /30 sized to what each site needs, then route between them with masks that match the plan. · 5 steps · ~18 min · 4 devices