How CIDR prefix lengths split 32-bit IPv4 addresses cleanly
Every IPv4 address consists of 32 binary bits grouped for human convenience into four 8-bit decimal octets separated by dots (for example 192.168.10.0). Classless Inter-Domain Routing (CIDR) appends a clean slash suffix (such as /24 or /26) telling routers exactly how many leading bits form the fixed network prefix versus how many trailing bits remain free for individual host addresses.
Total IP Addresses in Block = 2^(Host Bits)
Standard Usable Host IPs = 2^(Host Bits) − 2 (reserving Network ID & Broadcast IP)
Planning cloud VPC networks on AWS, Azure, GCP, or Oracle Cloud Infrastructure requires getting subnet boundaries exact from day one—overlapping CIDR blocks or under-sized /28 database subnets block peering later and force messy instance migrations.
Essential IPv4 CIDR subnet cheat sheet (/20 through /32)
| CIDR Prefix | Subnet Mask | Total IPs | Standard Usable Hosts | Common Infrastructure Role |
|---|---|---|---|---|
/16 | 255.255.0.0 | 65,536 | 65,534 | Master cloud VPC root address block (e.g. 10.0.0.0/16) |
/20 | 255.255.240.0 | 4,096 | 4,094 | Large Kubernetes pod/cluster subnet |
/24 | 255.255.255.0 | 256 | 254 | Standard office LAN or regional VPC availability-zone tier |
/25 | 255.255.255.128 | 128 | 126 | Halving one /24 cleanly into two isolated 128-IP subnets (.0 and .128) |
/26 | 255.255.255.192 | 64 | 62 | Quartering a /24 across DMZ, app, database, and management tiers |
/28 | 255.255.255.240 | 16 | 14 | Tight bastion or managed NAT/load-balancer subnet |
/30 | 255.255.255.252 | 4 | 2 | Point-to-point router or BGP VPN tunnel link |
/32 | 255.255.255.255 | 1 | 1 (Single host) | Exact firewall allowlist entry (your office VPN IP) |
Three-step subnetting check before allocating firewalls or cloud VPCs
- Verify boundary alignment cleanly: A valid
/26block MUST start on a multiple of 64 (.0,.64,.128, or.192). Writing10.0.1.30/26actually maps down to network10.0.1.0/26(covering.0–.63), surprising engineers expecting.30–.93! Enter any IP/prefix into Subnet & CIDR Calculator to view exact network boundary, broadcast address, first/last usable host, and binary mask immediately. - Account for cloud vendor reserved IPs: While textbook RFC networks reserve 2 addresses (network ID and broadcast), cloud platforms like AWS VPC reserve 5 addresses in every subnet (
.0network,.1VPC router,.2DNS resolver,.3future reserved, and broadcast), leaving64 − 5 = 59usable instance IPs inside a/26! - Keep RFC 1918 private blocks strictly separated across VPNs: When connecting multiple offices or clouds over WireGuard/IPsec, carve distinct non-overlapping slices (e.g.
10.10.0.0/16HQ vs10.20.0.0/16Oracle Cloud) rather than defaulting everything to192.168.1.0/24. Inspect binary octet transitions via Number Base Converter or verify public egress IP ranges with IP Address & Geolocation Inspector.
Understanding wildcard masks and firewall ACL syntax
Cisco IOS ACLs, OSPF router configurations, and several firewall rule syntaxes request a wildcard mask (inverse subnet mask) instead of a dotted subnet mask. Finding wildcard masks takes simple subtraction from 255.255.255.255: a /24 mask (255.255.255.0) flips cleanly to wildcard 0.0.0.255, while a /26 mask (255.255.255.192) flips to 0.0.0.63. Subnet & CIDR Calculator computes wildcard masks, host totals, and binary bit splits locally right in your browser without sending internal architecture plans over the network.
Worked multi-tier VPC design example from a single /22 parent block
Suppose an infrastructure engineer receives a clean 10.40.0.0/22 cloud VCN/VPC parent allocation (1,024 total IPs spanning 10.40.0.0 through 10.40.3.255) to deploy public load balancers, private application containers, managed PostgreSQL instances, and Site-to-Site VPN gateways across two availability zones. Carve subnets sequentially along clean power-of-two boundaries so route tables summarize cleanly: allocate 10.40.0.0/25 (128 IPs) to Public ALB Tier A and 10.40.0.128/25 to Public ALB Tier B; place Private App containers inside 10.40.1.0/24 (256 IPs) and 10.40.2.0/24; and reserve 10.40.3.0/26 alongside 10.40.3.64/26 for isolated database nodes, leaving 10.40.3.128/25 open for future Kubernetes worker pools—all double-checked conflict-free inside Subnet & CIDR Calculator before applying cloud network scripts.