Lesson 21 of 60 intermediate

IP Addressing & Subnetting

The math that filters network candidates

Open interactive version (quiz + challenge)

Real-world analogy

IP subnetting is like apartment numbering in a huge building. The prefix tells you the building and floor; the host bits tell you the unit. If you can’t split buildings into floors and units without getting lost, you can’t run a real network.

What is it?

Subnetting is how large address spaces are split into manageable, isolated segments with their own gateway and broadcast boundary. It underlies routing, VLAN design, firewalling, and scaling.

Real-world relevance

You must carve 10.0.0.0/16 into 4 branches of roughly 500 hosts each. /23 gives 510 usable hosts per branch — perfect. Branch 1: 10.0.0.0/23. Branch 2: 10.0.2.0/23. Branch 3: 10.0.4.0/23. Branch 4: 10.0.6.0/23. You just planned a network in 30 seconds.

Key points

Code example

// 5 subnet problems to practice

1) Given 192.168.10.0/24, how many usable hosts?
     answer: 254

2) Given 10.20.0.0/22, give network, broadcast, usable range.
     network   10.20.0.0
     broadcast 10.20.3.255
     usable    10.20.0.1 - 10.20.3.254

3) You need 60 hosts per site, 10 sites. Minimum prefix?
     /26 (62 usable) fits 60; 10 sites means block 10.x.y.0/26 pattern.

4) You need WAN point-to-point. What prefix and why?
     /30 -> exactly 2 usable hosts (one per router).

5) Is 10.0.4.130 in 10.0.4.0/25?
     /25 covers 10.0.4.0-10.0.4.127. So 10.0.4.130 is NOT in it.

Line-by-line walkthrough

  1. 1. Practice subnet problems block
  2. 2. Problem 1 — hosts in /24
  3. 3. Answer
  4. 4. Blank separator
  5. 5. Problem 2 — /22 enumeration
  6. 6. Network address
  7. 7. Broadcast address
  8. 8. Usable range
  9. 9. Blank separator
  10. 10. Problem 3 — choose prefix for 60 hosts
  11. 11. Chosen prefix reasoning
  12. 12. Blank separator
  13. 13. Problem 4 — WAN link
  14. 14. /30 chosen with reason
  15. 15. Blank separator
  16. 16. Problem 5 — subnet membership check
  17. 17. Subnet bounds and conclusion

Spot the bug

Plan: Allocate 4 branches of 300 hosts each from 10.0.0.0/16 using /23 subnets:
  Branch1 10.0.0.0/23
  Branch2 10.0.1.0/23
  Branch3 10.0.2.0/23
  Branch4 10.0.3.0/23
Need a hint?
Do these /23 subnets actually start at correct boundaries?
Show answer
No. /23 block size is 512 addresses, so subnets must start at multiples of 2 in the third octet: 10.0.0.0, 10.0.2.0, 10.0.4.0, 10.0.6.0. ‘10.0.1.0/23’ and ‘10.0.3.0/23’ overlap previous subnets. Correct: Branch1 10.0.0.0/23, Branch2 10.0.2.0/23, Branch3 10.0.4.0/23, Branch4 10.0.6.0/23.

Explain like I'm 5

The internet is a city. Your subnet is your street. The mask decides which houses are on the same street. The gateway is the bridge out of your street. Get the street right and the bridge right — and mail gets delivered.

Fun fact

In many real Bangladesh bank interview panels, subnetting is still the single skill where candidates visibly separate themselves. Not because it’s deep math — because most juniors didn’t practice it enough to answer in 60 seconds.

Hands-on challenge

Without a calculator, on paper, solve all 5 subnet problems in the code block. Then invent 3 more subnets of your own and solve them. Subnetting is a reflex — build it.

More resources

Open interactive version (quiz + challenge) ← Back to course: IT Jobs Bootcamp