Subnetting Cheat Sheet

CIDR notation, subnet mask calculations, determining network/broadcast addresses, VLSM, and practical subnetting shortcuts for network design.

Last Updated: May 1, 2025

CIDR Quick Reference

PrefixSubnet MaskTotal IPsUsable HostsClass
/32255.255.255.25511 (host route)
/30255.255.255.25242Point-to-point
/29255.255.255.24886Small subnet
/28255.255.255.2401614Small office
/27255.255.255.2243230Department
/26255.255.255.1926462Medium subnet
/25255.255.255.128128126Large subnet
/24255.255.255.0256254Class C
/16255.255.0.065,53665,534Class B
/8255.0.0.016,777,21616,777,214Class A

Calculating Subnets

Network Address
IP & subnet mask = first address in the subnet
Broadcast Address
Network address + (total hosts - 1)
Host range
Network+1 through Broadcast-1 (usable IPs)
Example: 192.168.1.50/27
Network=192.168.1.32, Broadcast=192.168.1.63, 30 usable
Wildcard mask
255.255.255.255 - subnet mask (used in ACL/Cisco)
/27 wildcard
255.255.255.255 - 255.255.255.224 = 0.0.0.31

VLSM (Variable Length Subnet Masking)

ItemDescription
ConceptSubnet a subnet — use different mask lengths across network
Step 1Sort required subnets by size (largest first) — prevents gaps
Step 2Allocate largest subnet first at the start of address space
Step 3Continue allocating from the next available address after each subnet
BenefitEfficient IP usage — no wasted addresses from fixed-size subnets
Example: 192.168.1.0/2460 hosts(/26), 25 hosts(/27), 10 hosts(/28), 2 hosts(/30)

Subnetting Shortcuts

ItemDescription
Block size256 - (last non-255 octet) = # of IPs per subnet in that octet
/26 block size256 - 192 = 64 IPs per subnet
Magic number trickSubtract prefix from max: /27 = 32 - 27 = 5; 2^5 = 32 IPs
Subnet zeroAddress space where subnet bits are all zero (usable in modern)
All-ones subnetAddress space where subnet bits are all ones (usable in modern)
Pro Tip: Quick reference: /24 = 256 IPs, /16 = 65,536 IPs, /8 = 16.7M IPs. For usable hosts, subtract 2 (network + broadcast). To double a subnet, subtract 1 from prefix (/24→/23).