InfraBench / network / cidr-vpc

IPv4 CIDR & Cloud VPC Subnet Planner

Subnet masks, AWS/Azure/GCP reserved IPs, 32-bit binary mask, Terraform & Netplan output

Presets:
Network / CIDR
-
-
Subnet Mask
-
-
Usable Host Range
-
-
Usable Hosts
-
-
32-bit Network / Host Split
Subnet Allocation Plan
#Subnet CIDRFirst UsableLast UsableBroadcastUsable IPs
Generated Infrastructure Snippets
terraform · aws_vpc / aws_subnet

          
ubuntu netplan · first subnet sample

          

Technical Guide: Cloud VPC Reserved IP Addresses & CIDR Planning

Traditional RFC 1918 / on-premises IPv4 subnetting reserves only two addresses per subnet: the first address (network identifier) and the last address (broadcast address). However, major public cloud providers reserve additional host addresses inside every subnet for virtual routing, DNS resolution, and platform infrastructure. Using a standard on-prem calculator for cloud VPC design frequently causes IP exhaustion in small subnets like /28 or /27.

Cloud Provider Reservation Differences

EnvironmentReserved / SubnetReserved OffsetsUsable IPs in /24Usable IPs in /28
Standard RFC 1918 / On-Prem2.0 (Net), .last (Bcast)25414
AWS VPC5.0 (Net), .1 (Router), .2 (DNS), .3 (Future), .last (Bcast)25111
Microsoft Azure VNet5.0 (Net), .1 (Default GW), .2-.3 (Azure DNS), .last (Bcast)25111
Google Cloud VPC4.0 (Net), .1 (Default GW), .last-1 (Second-to-last), .last (Bcast)25212

Practical VPC Sizing Recommendations

  • Leave Room for Kubernetes & Load Balancers: Managed Kubernetes clusters (EKS, AKS, GKE) and Application Load Balancers consume ENIs and secondary IPs rapidly. Avoid /26 or smaller for application tiers unless strictly isolated.
  • Avoid Overlapping RFC 1918 Ranges Across Environments: If you ever plan to connect home labs, on-premises offices, and cloud VPCs over WireGuard, Tailscale, or AWS Transit Gateway, avoid putting everything in 192.168.0.0/24 or 10.0.0.0/16. Carve non-overlapping /16 or /20 supernets per environment.
  • Check Point-to-Point Links (/31 and /32): Per RFC 3021, /31 subnets provide 2 usable host addresses for router point-to-point links, while /32 represents a single host route (such as a loopback or WireGuard peer address).

Frequently Asked Questions

Why does AWS VPC reserve 5 IP addresses in every subnet?

In every AWS VPC subnet, AWS reserves the base network address (+0), the VPC router (+1), the Amazon-provided DNS server (+2), one address reserved for future use (+3), and the broadcast address (last IP). Even though AWS VPC does not support traditional Layer-2 broadcast, the last address remains reserved.

What is the difference between a Subnet Mask and a Wildcard Mask?

A subnet mask sets network bits to 1 and host bits to 0 (e.g., 255.255.255.0 for /24). A wildcard mask is the bitwise inverse (0.0.0.255), commonly used in Cisco IOS ACLs, OSPF network statements, and firewall rules where 0 means "must match" and 1 means "ignore".

When should I use RFC 6598 CGNAT (100.64.0.0/10)?

100.64.0.0/10 is shared address space originally allocated for Carrier-Grade NAT and widely adopted by mesh VPNs (like Tailscale) and Kubernetes pod overlays when standard RFC 1918 ranges are already heavily allocated in corporate networks.