OpsPane

Split a VPC CIDR into aligned subnets per AZ, sized by prefix or host count (EKS pods), with AWS usable IPs, dual-stack /64s and aws_subnet Terraform.

Availability Zones
Subnet tiers — one subnet per tier in each AZ

Size each tier as a prefix (/24) or as the addresses it needs (500). Leave a tier empty to skip it.

/24 · 251 usable each

/20 · 4,091 usable each

Pod IPs per AZ =Max pods per instance type →

6 subnets in 10.0.0.0/16 · 13,056 of 65,536 addresses allocated

10.0.0.010.0.255.255
Address space of the VPC, from its first to its last address, with each subnet in place.
  • Public
  • Private
  • Free
SubnetCIDRUsable range (AWS)Usable IPsIPv6 CIDR
Public a10.0.48.0/2410.0.48.4 – 10.0.48.254251
Public b10.0.49.0/2410.0.49.4 – 10.0.49.254251
Public c10.0.50.0/2410.0.50.4 – 10.0.50.254251
Private a10.0.0.0/2010.0.0.4 – 10.0.15.2544,091
Private b10.0.16.0/2010.0.16.4 – 10.0.31.2544,091
Private c10.0.32.0/2010.0.32.4 – 10.0.47.2544,091

52,480 addresses (80.1%) left for later subnets:

  • 10.0.51.0/24
  • 10.0.52.0/22
  • 10.0.56.0/21
  • 10.0.64.0/18
  • 10.0.128.0/17

Terraform

One aws_subnet per row, with the subnet tags the AWS Load Balancer Controller discovers on EKS. Assumes your aws_vpc resource is named main.

subnets.tf
Updated Runs locally in your browser

Quick answer

  • AWS reserves 5 addresses in every subnet: the network address, the VPC router, DNS, one for future use and the broadcast address. A /24 has 256 addresses and 251 usable.
  • A subnet or VPC CIDR block is /16 to /28: a /28 has 11 usable addresses and a /16 has 65,531.
  • EKS Pods subnet: nodes per AZ × max Pods per node. 30 m5.large nodes × 29 = 870 addresses, a /22 (1,019 usable).
  • Place the largest subnets first so every block stays aligned without gaps; a subnet's IPv4 CIDR can't be resized later.

How to plan VPC subnets across Availability Zones

  1. 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 /56 AWS assigned, or an IPAM block): every subnet gets the next /64.
  2. 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.
  3. 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.
  4. 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:

SubnetCIDRUsable IPs
Pods a10.0.0.0/198,187
Pods b10.0.32.0/198,187
Pods c10.0.64.0/198,187
Private a10.0.96.0/204,091
Private b10.0.112.0/204,091
Private c10.0.128.0/204,091
Public a10.0.144.0/24251
Public b10.0.145.0/24251
Public c10.0.146.0/24251

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.

PrefixAddressesAWS usableAzure usableGCP usablePer /16 VPC
/1665,53665,53165,53165,5321
/1732,76832,76332,76332,7642
/1816,38416,37916,37916,3804
/198,1928,1878,1878,1888
/204,0964,0914,0914,09216
/212,0482,0432,0432,04432
/221,0241,0191,0191,02064
/23512507507508128
/24256251251252256
/25128123123124512
/26645959601,024
/27322727282,048
/28161111124,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:

AddressReserved for
10.0.0.0Network address
10.0.0.1VPC router
10.0.0.2Amazon DNS (base of the VPC + 2)
10.0.0.3Reserved for future use
10.0.0.255Broadcast (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 AZInstanceMax PodsPod IPsSubnetUsableHeadroom
10m5.large29290/23507217
30m5.large29870/221,019149
20m5.xlarge581,160/212,043883
50m5.2xlarge582,900/204,0911,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 subnetsAddressesWhere it comes from
/441,048,5762⁸⁴IPAM or BYOIP
/4865,5362⁸⁰IPAM or BYOIP
/524,0962⁷⁶IPAM or BYOIP
/562562⁷²Amazon-provided (always /56), IPAM, BYOIP
/60162⁶⁸IPAM or BYOIP

The default plan as dual-stack, with the docs' example block 2001:db8:1234:1a00::/56:

SubnetIPv4 CIDRIPv6 CIDRcidrsubnet netnum
Public a10.0.48.0/242001:db8:1234:1a00::/640
Public b10.0.49.0/242001:db8:1234:1a01::/641
Public c10.0.50.0/242001:db8:1234:1a02::/642
Private a10.0.0.0/202001:db8:1234:1a03::/643
Private b10.0.16.0/202001:db8:1234:1a04::/644
Private c10.0.32.0/202001:db8:1234:1a05::/645

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:

AddressReserved for
2001:db8:1234:1a00::Network address
2001:db8:1234:1a00::1VPC router
2001:db8:1234:1a00::2Reserved by AWS
2001:db8:1234:1a00::3Reserved by AWS
2001:db8:1234:1a00:ffff:ffff:ffff:ffffReserved 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

FAQ

How many usable IP addresses does a /24 subnet have in AWS?

251. A /24 holds 256 addresses and AWS reserves 5 in every subnet: in 10.0.0.0/24 those are 10.0.0.0, 10.0.0.1, 10.0.0.2, 10.0.0.3, 10.0.0.255 — the network address, the VPC router, DNS, one for future use and the broadcast address.

What are the smallest and largest subnets AWS allows?

A subnet (and a VPC CIDR block) can be /28 to /16. A /28 has 16 addresses and 11 usable; a /16 has 65,536 and 65,531 usable. For more room, associate secondary CIDR blocks with the VPC — each is again /16 to /28.

How big should a subnet for EKS Pods be?

Multiply nodes per AZ by max Pods per node: 30 m5.large nodes × 29 Pods = 870 addresses, which needs a /22 (1,019 usable on AWS). Type the product into the Pods tier — or the two numbers into the helper — and the planner picks the prefix. Add headroom for rolling updates, which run old and new Pods at once.

Why are the largest subnets placed first?

Every block must start on a multiple of its own size. Put a /24 at 10.0.0.0 and the next /20 can't start until 10.0.16.0, wasting 3,840 addresses. Placing blocks from largest to smallest leaves no gaps, so a plan fits whenever the subnets' total is no bigger than the VPC — and the leftover space stays in one piece at the end.

Do Azure and Google Cloud reserve the same addresses?

Azure also reserves 5 per subnet (network, default gateway, two for Azure DNS, broadcast), so a /24 has 251 usable. Google Cloud reserves 4 in a primary range (network, gateway, second-to-last and broadcast): 252 usable in a /24, and nothing in secondary ranges. This planner allocates for AWS; the table above compares all three.

What IPv6 CIDR sizes does AWS allow for a VPC and a subnet?

A VPC IPv6 block is /44 to /60 in steps of /4, and an Amazon-provided block is always a /56 you can't choose; a VPC can hold up to five IPv6 blocks. Subnet IPv6 blocks are /44 to /64, also in steps of /4. A /56 holds 256 /64 subnets — the size this planner gives each subnet, and the one aws_subnet.ipv6_cidr_block is documented with.

Does AWS reserve IPv6 addresses in a subnet?

Yes, the same five as for IPv4: the first four IPv6 addresses and the last one of every subnet block can't be assigned — in 2001:db8:1234:1a00::/64 that is 2001:db8:1234:1a00::, 2001:db8:1234:1a00::1, 2001:db8:1234:1a00::2, 2001:db8:1234:1a00::3, 2001:db8:1234:1a00:ffff:ffff:ffff:ffff. Against a /64's 2⁶⁴ addresses the loss doesn't matter, so the planner doesn't count IPv6 usable addresses.

Can I resize a subnet after creating it?

No. AWS fixes a subnet's IPv4 CIDR at creation — to grow, create a new subnet in free space and move workloads, or add a secondary CIDR block to the VPC. That is why the planner shows the free space it leaves: keep a few aligned blocks spare for the subnets you will need later.

Private by design

Your input is processed in this browser tab and never sent to our servers. Privacy policy