IPv6 in AWS: Overview and Configuration
Introduction to IPv6
- IPv6 was developed due to the exhaustion of IPv4 addresses, which were limited to 4.3 billion unique addresses.
- IPv6 Address Space: Offers approximately 3.4 x 10^38 unique IP addresses, significantly expanding the number of available addresses.
- Public and Internet-Routable: Unlike IPv4, IPv6 does not have private address ranges; all IPv6 addresses are public.
- Format: IPv6 addresses are written as eight groups of four hexadecimal digits (e.g.,
X:X:X:X:X:X:X:X, where X ranges from 0000 to ffff).
IPv6 in AWS VPC
- Dual Stack Mode: AWS supports IPv6 in Virtual Private Clouds (VPCs), allowing EC2 instances to operate with IPv4 and IPv6 addresses. This setup enables instances to communicate via either protocol through an internet gateway.
- IPv4 and IPv6: IPv4 cannot be disabled in VPCs and subnets. However, IPv6 can be enabled alongside IPv4 to provide dual-stack capabilities for resources.
Example: EC2 Instance with IPv6
- An EC2 instance in a VPC can have private IPv4 and public IPv6 addresses.
- Internet Accessibility: The instance can access the Internet and be accessed from the Internet via its public IPv6 address through an Internet gateway.
Troubleshooting IPv6 in AWS
- Scenario: If launching an EC2 instance fails due to IP address allocation issues, it's likely due to the exhaustion of IPv4 addresses in the subnet, not IPv6.
- Solution: Add an IPv4 CIDR to the subnet to resolve this issue. This will allow new EC2 instances to launch with new IPv4 addresses without affecting IPv6 allocations.
Summary
- IPv6 addresses the limitations of IPv4 address exhaustion by providing many IP addresses.
- AWS supports IPv6 in VPCs, enabling resources like EC2 instances to use IPv4 and IPv6 addresses.
- Troubleshooting in IPv6 environments often involves ensuring sufficient IPv4 addresses are available in the subnet, highlighting the importance of planning IP address allocation in cloud environments.