Skip to content

Subnetting Workshop

Subnetting is the process of dividing a single IP network into smaller, more manageable Sub-networks. Every systems engineer needs fluency in subnetting — it is non-negotiable for network Design, troubleshooting, firewall rule authoring, and certification exams. This workshop covers the Binary method, VLSM, route summarization, wildcard masks, IPv6 subnetting, and a systematic approach To subnet planning.

The core skill is answering this question: given a network and a requirement, find the subnet mask, Network address, broadcast address, and usable host range. This document provides the method, Practice, and reference material to develop that skill.

The binary method is the most reliable approach to subnetting because it works for every problem Type. Decimal tricks break down at edge cases; binary does not.

A subnet mask is a 32-bit number where the leftmost bits (the network portion) are all 1s and the Rightmost bits (the host portion) are all 0s. The boundary between 1s and 0s is the subnet boundary.

/24 mask: 11111111.11111111.11111111.00000000 = 255.255.255.0
/25 mask: 11111111.11111111.11111111.10000000 = 255.255.255.128
/26 mask: 11111111.11111111.11111111.11000000 = 255.255.255.192
/27 mask: 11111111.11111111.11111111.11100000 = 255.255.255.224
/28 mask: 11111111.11111111.11111111.11110000 = 255.255.255.240
/29 mask: 11111111.11111111.11111111.11111000 = 255.255.255.248
/30 mask: 11111111.11111111.11111111.11111100 = 255.255.255.252
/32 mask: 11111111.11111111.11111111.11111111 = 255.255.255.255

Given: IP address 10.4.220.75 and prefix length /26. Find network address, broadcast address, First host, last host, and total usable hosts.

Step 1: Convert the IP address to binary.

10 = 00001010
4 = 00000100
220 = 11011100
75 = 01001011

So 10.4.220.75 = 00001010.00000100.11011100.01001011

Step 2: Write the subnet mask in binary.

/26 means the first 26 bits are the network portion:

11111111.11111111.11111111.11000000

Step 3: Apply the mask (bitwise AND) to find the network address.

IP: 00001010.00000100.11011100.01001011
Mask: 11111111.11111111.11111111.11000000
AND: 00001010.00000100.11011100.01000000

Convert back to decimal: 10.4.220.64

Step 4: Find the broadcast address.

Set all host bits to 1:

Network: 00001010.00000100.11011100.01000000
Host bits: ^^^^^^
Broadcast: 00001010.00000100.11011100.01111111

Convert back to decimal: 10.4.220.127

Step 5: Determine first and last usable hosts.

First host = network address + 1 = 10.4.220.65
Last host = broadcast address - 1 = 10.4.220.126

Step 6: Calculate total usable hosts.

Host bits = 3226=632 - 26 = 6. Total addresses = 26=642^6 = 64. Usable = 642=6264 - 2 = 62.

Longest prefix match is the fundamental rule of IP routing. The routing table is searched for the Entry with the longest matching prefix. If there are multiple entries with the same prefix length, The one with the lowest administrative distance wins. If there is still a tie, ECMP (Equal-Cost Multi-Path) load balancing is used.

Summarization only works when the networks being summarized are contiguous and aligned to the Summary boundary. If you have 192.168.16.0/24 and 192.168.20.0/24You cannot create a single Clean summary because the range 17-19 is missing. Attempting to summarize to /21 (192.168.16.0/21) would include addresses you do not control, potentially creating a black hole.

A wildcard mask is the inverse of a subnet mask. Where the subnet mask has 1s, the wildcard mask Has 0s, and vice versa. Wildcard masks are used in ACLs (Access Control Lists) on Cisco and other Network equipment.

Subnet mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
Wildcard mask: 0.0.0.255 = 00000000.00000000.00000000.11111111
Subnet mask to wildcard: subtract each octet from 255
255.255.255.192 -> 0.0.0.63
255.255.255.224 -> 0.0.0.31
255.255.255.240 -> 0.0.0.15
255.255.255.248 -> 0.0.0.7
255.255.255.252 -> 0.0.0.3
255.255.255.254 -> 0.0.0.1
! Permit traffic from 192.168.10.0/24
access-list 10 permit 192.168.10.0 0.0.0.255
! Permit traffic from 10.0.0.0/8
access-list 10 permit 10.0.0.0 0.255.255.255
! Permit a single host
access-list 10 permit 192.168.1.5 0.0.0.0
! Permit 172.16.4.0/22 (network and broadcast)
access-list 10 permit 172.16.4.0 0.0.3.255
! Deny odd-numbered /24 subnets in 192.168.0.0/16
! 0 = 00000000, 1 = 00000001
! We want to match where the last bit of the 3rd octet is 1
! Wildcard for 3rd octet: 00000001 = 1, with value check = 0
access-list 10 deny 192.168.0.0 0.0.254.255

Best practice for enterprise: use DHCPv6 for servers and managed endpoints (control, tracking, DNS Integration) and SLAAC with privacy extensions (RFC 7217) for client devices (simplicity, privacy).

  1. All LAN segments must be /64. This is not a suggestion. RFC 7421 explains why: many IPv6 features (NDP, SLAAC, EUI-64) assume /64. Do not subnet a LAN to /112 or /120 just because you think you will not need 2^64 addresses. The address space is vast; use it as designed.
  2. Point-to-point links should also be /64. Unlike IPv4 where you use /31 or /32IPv6 point-to-point links get a full /64. There is no address scarcity.
  3. Loopback addresses are /128. The loopback ::1/128 is a single address, not a subnet.
2n2^nValue
202^01
212^12
222^24
232^38
242^416
252^532
262^664
272^7128
282^8256
292^9512
2102^{10}1,024
2112^{11}2,048
2122^{12}4,096
2132^{13}8,192
2142^{14}16,384
2152^{15}32,768
2162^{16}65,536
PrefixMaskWildcardMagic #AddressesUsable
/24255.255.255.00.0.0.255256256254
/25255.255.255.1280.0.0.127128128126
/26255.255.255.1920.0.0.63646462
/27255.255.255.2240.0.0.31323230
/28255.255.255.2400.0.0.15161614
/29255.255.255.2480.0.0.7886
/30255.255.255.2520.0.0.3442
/31255.255.255.2540.0.0.1222*
/32255.255.255.2550.0.0.0111

*/31 per RFC 3021: no network/broadcast, both addresses usable.

PrefixMaskWildcardMagic #AddressesUsable
/16255.255.0.00.0.255.25525665,53665,534
/17255.255.128.00.0.127.25512832,76832,766
/18255.255.192.00.0.63.2556416,38416,382
/19255.255.224.00.0.31.255328,1928,190
/20255.255.240.00.0.15.255164,0964,094
/21255.255.248.00.0.7.25582,0482,046
/22255.255.252.00.0.3.25541,0241,022
/23255.255.254.00.0.1.2552512510

Q: What is the last usable host address on the subnet containing 10.150.75.201/27?

A: /27 has magic number 32. Multiples of 32: …, 64, 96, 128, 160, 192. The IP .201 falls In the .192 subnet.

Network: 10.150.75.192
Broadcast: 10.150.75.223
Last host: 10.150.75.222

Q: How many usable subnets does 172.16.0.0/21 create from 172.16.0.0/16?

A: The original prefix is /16The new prefix is /21. Subnet bits = 2116=521 - 16 = 5. Number of Subnets = 25=322^5 = 32. Each subnet has 3221=1132 - 21 = 11 host bits, giving 2112=20462^{11} - 2 = 2046 usable Hosts.

Q: You need to summarize 10.1.0.0/16``10.2.0.0/16``10.3.0.0/16And 10.4.0.0/16. What is The summary?

A: Convert second octets to binary:

1 = 00000001
2 = 00000010
3 = 00000011
4 = 00000100

Common bits from left: only 00000 (5 bits) are shared by all four. Wait — let me recheck.

00000001
00000010
00000011
00000100

Bits from left: 00000 are common to all (5 bits). The 6th bit varies (0, 0, 0, 1). So the summary Prefix is $8 + 5 = /13`.

Summary: 10.0.0.0/13

This covers 10.0.0.0 through 10.7.255.255. It includes more than the four specified networks (it Also covers 5, 6, 7). If you only want to summarize exactly those four, you need multiple summary Routes or accept the over-summarization.