AWS Builder Center

๐ŸŒ IPv6 Fundamentals on AWS: Understanding CIDR Blocks and VPC Routes

Learn to read IPv6 addresses, divide an AWS-provided range into subnets, and understand how IPv6 route tables direct traffic.

Sr Consultant, Cloud&Network Security
IPv6 addresses can look intimidating. Once you understand their structure and prefix lengths, planning an AWS network becomes much easier.
Letโ€™s explore three building blocks: IPv6 addresses, CIDR allocations, and route table entries.
๐Ÿ’ก Key highlight: An address identifies a network interface. A CIDR describes an address range. A route determines the next hop toward a destination. Security rules determine whether traffic is permitted.

๐Ÿ”ข 1. Reading an IPv6 address

IPv4 uses 32-bit addresses. IPv6 uses 128-bit addresses, written in hexadecimal.
Property
IPv4
IPv6
Address length
32 bits
128 bits
Example
10.20.1.10
2001:db8:1234:ab01::10
Format
Decimal groups separated by dots
Hexadecimal groups separated by colons
Default route
0.0.0.0/0
::/0
A full IPv6 address has eight groups, each representing 16 bits.
These three representations describe the same address:
Representation
Address
Expanded
2001:0db8:1234:ab01:0000:0000:0000:0010
Leading zeros removed
2001:db8:1234:ab01:0:0:0:10
Zero groups compressed
2001:db8:1234:ab01::10
Two rules make addresses easier to read:
  • Remove leading zeros within a group.
  • Replace one consecutive sequence of zero groups with ย ::ย .
Use ย ::ย  only once in an address, so the missing groups can be reconstructed unambiguously.
๐Ÿ“Œ Remember: Hexadecimal uses ย 0โ€“9ย  and ย aโ€“fย . The ending ย 10ย  above is hexadecimal, not decimal ten.
The ย 2001:db8::/32ย  addresses throughout this post are documentation examples. Use your actual AWS-assigned range when configuring resources.

๐Ÿงฎ 2. What does an IPv6 CIDR prefix mean?

Consider:
2001:db8:1234:ab00::/56
The ย /56ย  means the first 56 bits identify the network prefix. The remaining bits identify addresses within that range.
Prefix
Fixed prefix bits
Remaining bits
Meaning
/56
56
72
VPC allocation in our example
/64
64
64
Subnet allocation in our example
/128
128
0
One exact address
/0
0
128
All IPv6 addresses
๐Ÿ’ก CIDR highlight: A larger prefix number describes a smaller address range. A ย /64ย  is smaller than a ย /56ย .

Visual: dividing a ย /56ย  into ย /64ย  ranges

First 48 bits
Next 8 bits
Next 8 bits
Final 64 bits
2001:db8:1234
ab
00 through ff
Address within the subnet
Fixed VPC prefix
Fixed VPC prefix
Selects a /64 subnet range
Interface address space
Moving from ย /56ย  to ย /64ย  provides eight subnet-selection bits:
\[ 2^{64-56}=256 \]
So one ย /56ย  contains 256 possible ย /64ย  ranges. AWS subnet quotas separately determine how many subnets you can create.

โ˜๏ธ 3. Understanding Amazon-provided IPv6 CIDRs

A straightforward starting point is to request an Amazon-provided IPv6 CIDR for your VPC. In the standard allocation workflow, AWS assigns a ย /56ย ; you do not select the actual address range yourself.
AWS also supports allocation through IPAM and IPv6 ranges you bring to AWS.
Avoid treating ย /56ย  and ย /64ย  as universal requirements. Current AWS documentation supports VPC IPv6 sizes from ย /44ย  to ย /60ย , and subnet sizes from ย /44ย  to ย /64ย , in increments of four, subject to allocation constraints. We use a ย /56ย  VPC with ย /64ย  subnets for this example. ย Amazon Virtual Private Cloudย 

๐Ÿ—๏ธ Visual: VPC โ†’ subnets โ†’ instance address

Each subnet must fit inside the VPC allocation and must not overlap another subnet.
AWS reserves the first four and last IPv6 addresses in each subnet range. Although a ย /64ย  mathematically contains \(2^{64}\) addresses, not every address is assignable to EC2. ย Amazon Virtual Private Cloudย 

๐Ÿšฆ 4. Understanding IPv6 route table entries

Every route has two essential parts:
Field
Question it answers
Destination
Which destination address range matches?
Target
Where should matching traffic go?

๐Ÿ  The local route

For our VPC allocation, the local entry is:
Destination
Target
2001:db8:1234:ab00::/56
local
AWS creates the local route when you associate the IPv6 range with the VPC. It covers the VPC range, rather than requiring a local entry for each subnet.
In this basic design, traffic between the VPCโ€™s subnets uses that route. Security rules still determine whether communication is allowed.

๐ŸŒ Public IPv6 internet connectivity

A public-subnet route table can contain:
Destination
Target
2001:db8:1234:ab00::/56
local
::/0
Internet gateway
The internet gateway supports inbound and outbound IPv6 connectivity. Actual inbound access also requires suitable security rules and a listening application.

๐Ÿ”’ Outbound-only IPv6 internet connectivity

A private-subnet route table can contain:
Destination
Target
2001:db8:1234:ab00::/56
local
::/0
Egress-only internet gateway
The egress-only gateway permits outbound connections and their responses, while preventing internet-initiated connections through that gateway.
These are alternative route table designs. Choose one target for the ย ::/0ย  destination in each table.

Visual: two internet paths

๏ปฟ
Responses to the private resourceโ€™s outbound connections are allowed. Both designs remain subject to security controls.
๐Ÿ’ก Gateway highlight: An egress-only internet gateway does not translate IPv6 addresses. It controls connection initiation.

๐ŸŽฏ 5. Which route wins?

AWS generally selects the most specific matching route, known as longest prefix match. IPv4 and IPv6 routes are evaluated independently. ย Amazon Virtual Private Cloudย 
Consider this table, with an active IPv6-capable peering connection:
Destination
Target
2001:db8:1234:ab00::/56
local
2001:db8:5678:cd00::/56
VPC peering connection
::/0
Egress-only internet gateway
Here is how packets are routed:
Packet destination
Selected route
2001:db8:1234:ab01::10
Local VPC /56
2001:db8:5678:cd01::20
Remote VPC /56 through peering
Any other IPv6 destination
Default route ::/0
The remote ย /56ย  is more specific than ย /0ย , so matching packets use peering. Peering also requires appropriate reverse routes and security rules.
๐Ÿ“Œ Remember: ย 0.0.0.0/0ย  never substitutes for a missing IPv6 default route.

๐Ÿ›ก๏ธ 6. Routing and security work together

An Amazon-provided globally routable IPv6 address does not automatically make an instance accessible from the internet.
๏ปฟ
Check four layers:
  1. Address: Does the interface have an IPv6 address?
  1. Route: Does its subnet have the correct route table?
  1. Security: Do security groups, ACLs, and the host firewall allow traffic?
  1. Application: Does the service listen on IPv6?
For outbound HTTPS, separate security group rules might be:
Direction
Protocol/port
Destination
Outbound
TCP 443
0.0.0.0/0
Outbound
TCP 443
::/0
The first permits IPv4 HTTPS; the second permits IPv6 HTTPS.
Security groups are stateful. Custom network ACLs are stateless, so account for return traffic. Preserve necessary ICMPv6 messages, including Packet Too Big, for Path MTU Discovery.

Three similar-looking expressions

Expression
Meaning
::
Unspecified IPv6 address
::1
Loopback address
::/0
CIDR matching every IPv6 address

๐Ÿ› ๏ธ 7. Try it in the AWS console

  1. Add an Amazon-provided IPv6 CIDR to a VPC.
  1. Record the actual assigned allocation.
  1. Allocate distinct ย /64ย  ranges to two subnets.
  1. Inspect the automatically created IPv6 local route.
  1. For public connectivity, add ย ::/0ย  targeting an attached internet gateway.
  1. For outbound-only connectivity, use a separate table with ย ::/0ย  targeting an egress-only internet gateway.
  1. Verify each subnetโ€™s route table association.
  1. If testing EC2, assign an IPv6 address and review its security rules.
On a Linux instance:
ip -6 addr show scope global
ip -6 route show
curl -6 -I --connect-timeout 10 https://www.google.com
The first two commands show guest addresses and routes. They do not display the AWS VPC route table.
A successful HTTPS response demonstrates IPv6 connectivity to that destination.
๐Ÿ“ธ Suggested screenshots: VPC IPv6 allocation, subnet allocations, local route, and the two alternative default routes.

โš ๏ธ 8. Common mistakes

Mistake
Correction
Deploying documentation addresses
Use your AWS-assigned allocation
Assuming every AWS IPv6 subnet must be /64
Check current supported sizing
Expecting an IPv4 default route to carry IPv6
Configure ::/0
Editing the wrong route table
Check subnet associations
Assuming IPv4 rules permit IPv6
Add appropriate IPv6 rules
Expecting egress-only gateway to reach IPv4-only destinations
Use IPv4 or evaluate DNS64/NAT64
Assuming address assignment guarantees access
Check routes, security, and application support

โœ… Key takeaways

  • IPv6 uses 128-bit addresses.
  • Prefix lengths describe address ranges.
  • A ย /56ย  contains 256 ย /64ย  ranges.
  • The local route covers the VPCโ€™s IPv6 allocation.
  • ย ::/0ย  is the IPv6 default route.
  • Its target determines the internet path.
  • Addressing, routing, security, and application support must work together.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article