IPv4 Subnetting Practice Problems

Work through 10 real-world subnetting problems with step-by-step solutions covering address calculations, subnet sizing, and host ranges.

Problem 1: Basic Subnet Calculation

Given: 10.0.0.0/24. How many usable host addresses?

Solution: - /24 = 256 total addresses (2^8) - Subtract 2 (network + broadcast): 254 usable hosts - Network: 10.0.0.0, Broadcast: 10.0.0.255 - Usable range: 10.0.0.1 — 10.0.0.254

Problem 2: Subnet Mask to CIDR

Given: Subnet mask 255.255.240.0. What is the CIDR notation?

Solution:

255.255.240.0 = 11111111.11111111.11110000.00000000
Count the 1s:   8 + 8 + 4 = 20
Answer: /20

Problem 3: Splitting a Network

Given: 172.16.0.0/16. Split into 8 equal subnets.

Solution: - 8 subnets = 2^3 → borrow 3 bits → /16 + 3 = /19 - Each /19 has 8,190 usable hosts (2^13 - 2)

Subnet Network Broadcast Usable Range
1 172.16.0.0/19 172.16.31.255 .0.1 — .31.254
2 172.16.32.0/19 172.16.63.255 .32.1 — .63.254
3 172.16.64.0/19 172.16.95.255 .64.1 — .95.254
... ... ... ...
8 172.16.224.0/19 172.16.255.255 .224.1 — .255.254

Problem 4: Finding the Network Address

Given: Host IP 192.168.45.200/27.

Solution: - /27 = block size of 32 (2^5) - 200 / 32 = 6.25 → floor(6.25) x 32 = 192 - Network address: 192.168.45.192/27 - Broadcast: 192.168.45.223 - Usable: 192.168.45.193 — 192.168.45.222 (30 hosts)

Problem 5: How Many Subnets?

Given: Class B network 172.20.0.0/16 subnetted with mask 255.255.255.192.

Solution: - 255.255.255.192 = /26 - Bits borrowed from host: 26 - 16 = 10 - Number of subnets: 2^10 = 1,024 subnets - Hosts per subnet: 2^6 - 2 = 62 usable hosts

Quick Reference Formulas

Subnets created:        2^(new_mask - original_mask)
Hosts per subnet:       2^(32 - new_mask) - 2
Block size:             2^(32 - mask) or 256 - last_octet_of_mask
Next subnet address:    Current network + block size
Broadcast address:      Next subnet - 1

Tips for Speed

  • Memorize powers of 2: 2, 4, 8, 16, 32, 64, 128, 256
  • Memorize common masks: /24=256, /25=128, /26=64, /27=32, /28=16, /29=8, /30=4
  • Use the "256 minus" trick: 256 - 192 = 64 (block size for /26)

Xem thêm