2.3.1.6. IPv6 Adoption and Dual-Stack Migration
2.3.1.6. IPv6 Adoption and Dual-Stack Migration
💡 First Principle: IPv6 removes address scarcity and the need for NAT to reach the internet, but every IPv6 address is globally routable, so "private" is decided by routes and security rules rather than by the address range.
- Why adopt it: large estates run out of private IPv4 space (EKS pods each take an address), overlapping IPv4 ranges complicate connectivity, and AWS charges for every public IPv4 address (since February 2024). Some public-sector customers also have IPv6 mandates.
- Dual-stack building blocks: A VPC always keeps an IPv4 CIDR; you add an IPv6 /56 (Amazon-provided, your own through BYOIP, or allocated from a
"VPC IPAM"IPv6 pool), and each subnet gets a /64. ENIs then receive IPv6 addresses (auto-assign per subnet). IPv6-only subnets have no IPv4 at all and require Nitro-based instances. - Routing:
::/0to an internet gateway makes a subnet reachable from the IPv6 internet;::/0to an egress-only internet gateway lets instances start outbound IPv6 connections while blocking inbound ones, the IPv6 counterpart of a NAT gateway (no address translation). A NAT gateway does not provide IPv6 egress. - Security rules: security group and network ACL rules are per address family. An IPv4
0.0.0.0/0rule does not admit IPv6 traffic; add explicit IPv6 rules (::/0or specific prefixes). - Front doors: make the edge dual-stack first. ALB and NLB support the
dualstackIP address type (an ALB can also be dual-stack without public IPv4), CloudFront serves IPv6 viewers, and Route 53 AAAA alias records point to them, while the targets behind can stay IPv4 during the transition. - IPv6-only workloads that still call IPv4 services: enable DNS64 on the subnet (Route 53 Resolver synthesizes
64:ff9b::/96addresses for IPv4-only names), route64:ff9b::/96to a NAT gateway, which performs NAT64, and keep::/0on the egress-only internet gateway for native IPv6 destinations. NAT64 is built into every NAT gateway. - Hybrid and multi-VPC: Transit Gateway, Direct Connect and Site-to-Site VPN carry IPv6, VPC Flow Logs record IPv6 flows, and EKS can run IPv6 clusters in which pods get IPv6 addresses.
- Migration order: (1) plan IPv6 allocations in IPAM; (2) dual-stack the edge (CloudFront, load balancers, AAAA records); (3) dual-stack VPCs and subnets and add IPv6 routes and rules; (4) put new workloads in IPv6-only subnets with DNS64/NAT64 for remaining IPv4 dependencies; (5) release public IPv4 addresses that are no longer needed.
⚠️ Exam Trap: Assuming an instance with an IPv6 address in a subnet without an internet gateway route is "private" only because there is no NAT, or that a NAT gateway handles its IPv6 egress. Outbound-only IPv6 needs an egress-only internet gateway, and IPv6 traffic needs its own security group and NACL rules.