How to plan VPC subnets across Availability Zones
- Enter the VPC CIDR block — /16 to /28, ideally from a private range such as
10.0.0.0/16— and how many Availability Zones to spread across. For a dual-stack VPC, add its IPv6 block too (the/56AWS assigned, or an IPAM block): every subnet gets the next/64. - Size each tier as a prefix (
/24) or as the number of addresses it needs (500); the planner picks the smallest subnet whose usable count, after AWS's 5 reserved addresses, covers it. Leave a tier empty to skip it. - For a Pods tier, enter nodes per AZ and max Pods per node — the product becomes the size. The EKS Max Pods Calculator gives the per-node number for any instance type.
- Read the plan: the bar shows where every subnet sits in the VPC, the table lists each CIDR with its usable range (and its IPv6
/64), and the free blocks are what's left for later. Copy the Terraform, or copy the link to share the exact plan.
Worked example
A 10.0.0.0/16 VPC across 3 AZs with public /24, private /20 and Pods /19 subnets — the order the planner places them in:
| Subnet | CIDR | Usable IPs |
|---|---|---|
| Pods a | 10.0.0.0/19 | 8,187 |
| Pods b | 10.0.32.0/19 | 8,187 |
| Pods c | 10.0.64.0/19 | 8,187 |
| Private a | 10.0.96.0/20 | 4,091 |
| Private b | 10.0.112.0/20 | 4,091 |
| Private c | 10.0.128.0/20 | 4,091 |
| Public a | 10.0.144.0/24 | 251 |
| Public b | 10.0.145.0/24 | 251 |
| Public c | 10.0.146.0/24 | 251 |
The Pods subnets come first because they are the largest; 37,632 of 65,536 addresses are allocated and 27,904 stay free as 5 aligned blocks starting at 10.0.147.0.
Subnet sizes and usable addresses
Usable addresses per subnet after each cloud's reservations, for every size AWS accepts. “Per /16 VPC” is how many subnets of that size fit in the largest VPC CIDR block.
| Prefix | Addresses | AWS usable | Azure usable | GCP usable | Per /16 VPC |
|---|---|---|---|---|---|
/16 | 65,536 | 65,531 | 65,531 | 65,532 | 1 |
/17 | 32,768 | 32,763 | 32,763 | 32,764 | 2 |
/18 | 16,384 | 16,379 | 16,379 | 16,380 | 4 |
/19 | 8,192 | 8,187 | 8,187 | 8,188 | 8 |
/20 | 4,096 | 4,091 | 4,091 | 4,092 | 16 |
/21 | 2,048 | 2,043 | 2,043 | 2,044 | 32 |
/22 | 1,024 | 1,019 | 1,019 | 1,020 | 64 |
/23 | 512 | 507 | 507 | 508 | 128 |
/24 | 256 | 251 | 251 | 252 | 256 |
/25 | 128 | 123 | 123 | 124 | 512 |
/26 | 64 | 59 | 59 | 60 | 1,024 |
/27 | 32 | 27 | 27 | 28 | 2,048 |
/28 | 16 | 11 | 11 | 12 | 4,096 |
The 5 addresses AWS reserves
In every subnet the first four addresses and the last one can't be assigned to anything. For 10.0.0.0/24:
| Address | Reserved for |
|---|---|
10.0.0.0 | Network address |
10.0.0.1 | VPC router |
10.0.0.2 | Amazon DNS (base of the VPC + 2) |
10.0.0.3 | Reserved for future use |
10.0.0.255 | Broadcast (not supported, still reserved) |
Sizing subnets for EKS Pods
With the Amazon VPC CNI every Pod gets a VPC address, so the Pod subnet must hold nodes per AZ × max Pods per node. With custom networking (an ENIConfig per AZ) Pods draw from their own subnet — often in a secondary 100.64.0.0/10 CIDR — which is what the Pods tier models.
| Nodes per AZ | Instance | Max Pods | Pod IPs | Subnet | Usable | Headroom |
|---|---|---|---|---|---|---|
| 10 | m5.large | 29 | 290 | /23 | 507 | 217 |
| 30 | m5.large | 29 | 870 | /22 | 1,019 | 149 |
| 20 | m5.xlarge | 58 | 1,160 | /21 | 2,043 | 883 |
| 50 | m5.2xlarge | 58 | 2,900 | /20 | 4,091 | 1,191 |
With prefix delegation the CNI hands out whole /28 blocks (16 addresses) instead of single IPs, so the subnet needs free contiguous /28s — size generously and keep it dedicated, or the CNI fails with InsufficientCidrBlocks.
Dual-stack: IPv6 blocks on AWS
A VPC can add IPv6 to its IPv4 range. AWS takes a VPC IPv6 block from /44 to /60 in steps of /4; the planner gives each subnet one /64, in the order of the table, and writes it in Terraform with cidrsubnet() on the VPC's own ipv6_cidr_block, so the plan follows whatever block AWS assigns.
| VPC IPv6 block | /64 subnets | Addresses | Where it comes from |
|---|---|---|---|
/44 | 1,048,576 | 2⁸⁴ | IPAM or BYOIP |
/48 | 65,536 | 2⁸⁰ | IPAM or BYOIP |
/52 | 4,096 | 2⁷⁶ | IPAM or BYOIP |
/56 | 256 | 2⁷² | Amazon-provided (always /56), IPAM, BYOIP |
/60 | 16 | 2⁶⁸ | IPAM or BYOIP |
The default plan as dual-stack, with the docs' example block 2001:db8:1234:1a00::/56:
| Subnet | IPv4 CIDR | IPv6 CIDR | cidrsubnet netnum |
|---|---|---|---|
| Public a | 10.0.48.0/24 | 2001:db8:1234:1a00::/64 | 0 |
| Public b | 10.0.49.0/24 | 2001:db8:1234:1a01::/64 | 1 |
| Public c | 10.0.50.0/24 | 2001:db8:1234:1a02::/64 | 2 |
| Private a | 10.0.0.0/20 | 2001:db8:1234:1a03::/64 | 3 |
| Private b | 10.0.16.0/20 | 2001:db8:1234:1a04::/64 | 4 |
| Private c | 10.0.32.0/20 | 2001:db8:1234:1a05::/64 | 5 |
The 5 IPv6 addresses AWS reserves
As for IPv4, the first four and the last address of each subnet's IPv6 block can't be assigned. For 2001:db8:1234:1a00::/64:
| Address | Reserved for |
|---|---|
2001:db8:1234:1a00:: | Network address |
2001:db8:1234:1a00::1 | VPC router |
2001:db8:1234:1a00::2 | Reserved by AWS |
2001:db8:1234:1a00::3 | Reserved by AWS |
2001:db8:1234:1a00:ffff:ffff:ffff:ffff | Reserved by AWS (last address) |
That leaves 2⁶⁴ − 5 addresses in a /64, so IPv6 never runs a subnet out of addresses the way a /24 does. The Terraform sets assign_ipv6_address_on_creation to true so instances get an IPv6 address at launch (the provider default is false).
Public (GUA) or private (ULA)?
An Amazon-provided block is global unicast — public and reachable from the internet once a route and security group allow it; an egress-only internet gateway gives private subnets outbound-only IPv6. Private IPv6 comes only from Amazon VPC IPAM: unique local space in fd00::/8 outside Amazon's reserved fd00::/16, or a GUA range you own with the private option enabled. The planner refuses link-local, multicast and other special ranges, and fd00::/16.
Not modelled: IPv6-only subnets (they need Nitro instances and the VPC still needs an IPv4 block) and IPv6 subnet blocks larger than /64.
Gotchas this tool checks for
172.17.0.0/16 collides with Docker
Docker's default bridge is 172.17.0.0/16, and AWS warns that Cloud9 and SageMaker use it too: a host running Docker can't reach VPC addresses inside it. The planner warns when the VPC overlaps that range.
Host bits in the VPC CIDR
10.0.3.7/16 isn't a network address. The AWS API quietly stores it as 10.0.0.0/16; the planner says so and plans with the canonical block.
Ranges AWS refuses
0.0.0.0/8, loopback 127.0.0.0/8, link-local 169.254.0.0/16 and multicast 224.0.0.0/4 can't be VPC ranges; a public range is accepted but hides the real owners of those addresses from the VPC, so it gets a warning.
Verification
- The reserved addresses, the /16–/28 limits, the forbidden ranges and the 172.17.0.0/16 advice are quoted from the Amazon VPC User Guide (checked 2026-11-20); Azure's 5 and Google Cloud's 4 come from their own VPC documentation.
- The IPv6 rules — /44 to /60 VPC blocks in steps of /4, the Amazon-provided /56, five reserved IPv6 addresses per subnet, private IPv6 only through IPAM with fd00::/16 reserved — are from the same guide; the Terraform arguments from the AWS provider's aws_subnet and aws_vpc documentation.
- The engine's unit tests assert, for 300 seeded random plans and the boundary cases, that every subnet and free block is aligned to its size, sits inside the VPC and overlaps no other — plus exact vectors from /0 to /32 and 255.255.255.255.
- Parsing is as strict as Go's
net/netip: leading zeros (010.0.0.0) are rejected because some tools read them as octal. - The e2e spec proves the plan stays in this tab: no request carries your CIDR or sizes.