Lessons › Networking fundamentals
Subnetting in your head
▶ Start the interactive lesson
Stand-up, 9:30. Burrow is opening three new floors. Maya: "I need four equal subnets out of 192.168.10.0/24 by lunch. No calculators. It's an interview classic too." She writes one number on the whiteboard: 256.
Why split a network up?
One giant network for the whole company means every broadcast reaches every device, there's no separation between departments, and one problem can spread everywhere.
Making the street longer
A longer prefix means more bits for the network and fewer for hosts. Every extra network bit doubles the number of subnets and halves their size.
The magic number
Find the octet of the mask that isn't 255 or 0. Then block size = 256 − that number. /26 → mask 255.255.255.192 → 256 − 192 = 64.
Worked example: 192.168.10.77/26
Follow these steps every time. With practice it takes about 10 seconds.
Choosing the right size
Work backwards from how many devices you need: hosts + 2 (network and broadcast), then round up to a block. 50 users → 52 → block 64 → /26. 10 cameras → 12 → block 16 → /28.
Key points
- The magic number method: find the octet where the mask isn't 255 or 0 (the "interesting" octet).
- Block size = 256 − mask value in that octet. /26 → mask 255.255.255.192 → block = 256 − 192 = 64.
- Subnets start at multiples of the block: .0, .64, .128, .192. Each runs to one less than the next start (the broadcast).
- Usable hosts = block − 2 (the network and broadcast addresses can't be used).
- Quick table: /25=128 · /26=64 · /27=32 · /28=16 · /29=8 · /30=4 (a /30 gives exactly 2 hosts, perfect for router-to-router links).