Subnetting Workshop
Overview
Section titled “Overview”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.
Binary Method: Step by Step
Section titled “Binary Method: Step by Step”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.
The Subnet Mask in Binary
Section titled “The Subnet Mask in Binary”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.255Step-by-Step Method
Section titled “Step-by-Step Method”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 = 000010104 = 00000100220 = 1101110075 = 01001011So 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.11000000Step 3: Apply the mask (bitwise AND) to find the network address.
IP: 00001010.00000100.11011100.01001011Mask: 11111111.11111111.11111111.11000000AND: 00001010.00000100.11011100.01000000Convert back to decimal: 10.4.220.64
Step 4: Find the broadcast address.
Set all host bits to 1:
Network: 00001010.00000100.11011100.01000000Host bits: ^^^^^^Broadcast: 00001010.00000100.11011100.01111111Convert back to decimal: 10.4.220.127
Step 5: Determine first and last usable hosts.
First host = network address + 1 = 10.4.220.65Last host = broadcast address - 1 = 10.4.220.126Step 6: Calculate total usable hosts.
Host bits = . Total addresses = . Usable = .
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.
When Summarization Fails
Section titled “When Summarization Fails”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.
Wildcard Masks
Section titled “Wildcard Masks”What They Are
Section titled “What They Are”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.00000000Wildcard mask: 0.0.0.255 = 00000000.00000000.00000000.11111111Quick Conversion
Section titled “Quick Conversion”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.1ACL Examples
Section titled “ACL Examples”! Permit traffic from 192.168.10.0/24access-list 10 permit 192.168.10.0 0.0.0.255
! Permit traffic from 10.0.0.0/8access-list 10 permit 10.0.0.0 0.255.255.255
! Permit a single hostaccess-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 = 0access-list 10 deny 192.168.0.0 0.0.254.255Best 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).
IPv6 Subnetting Rules
Section titled “IPv6 Subnetting Rules”- 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/112or/120just because you think you will not need 2^64 addresses. The address space is vast; use it as designed. - Point-to-point links should also be
/64. Unlike IPv4 where you use/31or/32IPv6 point-to-point links get a full/64. There is no address scarcity. - Loopback addresses are
/128. The loopback::1/128is a single address, not a subnet.
Subnetting Quick Reference
Section titled “Subnetting Quick Reference”Powers of 2
Section titled “Powers of 2”| Value | |
|---|---|
| 1 | |
| 2 | |
| 4 | |
| 8 | |
| 16 | |
| 32 | |
| 64 | |
| 128 | |
| 256 | |
| 512 | |
| 1,024 | |
| 2,048 | |
| 4,096 | |
| 8,192 | |
| 16,384 | |
| 32,768 | |
| 65,536 |
Subnet Masks: /24 Through /30
Section titled “Subnet Masks: /24 Through /30”| Prefix | Mask | Wildcard | Magic # | Addresses | Usable |
|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | 2* |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | 1 |
*/31 per RFC 3021: no network/broadcast, both addresses usable.
Extended Reference: /16 Through /23
Section titled “Extended Reference: /16 Through /23”| Prefix | Mask | Wildcard | Magic # | Addresses | Usable |
|---|---|---|---|---|---|
| /16 | 255.255.0.0 | 0.0.255.255 | 256 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 128 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 64 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 32 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 16 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 8 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 4 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 2 | 512 | 510 |
Common Exam-Style Problems
Section titled “Common Exam-Style Problems”Problem 1
Section titled “Problem 1”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.192Broadcast: 10.150.75.223Last host: 10.150.75.222Problem 2
Section titled “Problem 2”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 = . Number of Subnets = . Each subnet has host bits, giving usable Hosts.
Problem 3
Section titled “Problem 3”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 = 000000012 = 000000103 = 000000114 = 00000100Common bits from left: only 00000 (5 bits) are shared by all four. Wait — let me recheck.
00000001000000100000001100000100Bits 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.