Elastic Container Instance supports IPv4 and IPv6 addresses. Compared with IPv4, IPv6 provides more IP addresses. This topic describes how to assign an IPv6 address to an elastic container instance.
Background information
IPv4 addresses are widely used. However, the limited number of IPv4 addresses restricts the development of the Internet. Compared with IPv4 addresses, IPv6 addresses are more sufficient and allow more types of devices to access the Internet. For more information, see What is an IPv6 gateway?
The following limits apply when you assign IPv6 addresses to elastic container instances:
You can assign only one IPv6 address to an elastic container instance.
All elastic container instances that are created by specifying the number of vCPUs and the memory size support IPv6 addresses. For elastic container instances that are created by specifying Elastic Compute Service (ECS) instance types, only the instances that are created based on the instance types of the following instance families support IPv6 addresses:
General-purpose instance families: g6e, g6, g5, and sn2ne
Compute-optimized instance families: c6e, c6a, c6, c5, and sn1ne
Memory-optimized instance families: r6e, r6, r5, and se1ne
Instance families with high clock speeds: hfc6 and hfg6
Compute-optimized GPU-accelerated instance families: gn6i, gn6v, and gn5i
Big data instance family with enhanced network performance: d1ne
Instance family with local SSDs: i2
Burstable instance families: t6 and t5
Shared instance family: s6
For more information, see Instance families.
Preparations
Enable IPv6 CIDR blocks for the virtual private cloud (VPC) in which the elastic container instance resides and for the vSwitch to which the elastic container instance is connected. For more information, see Enable IPv6 for a VPC and Enable IPv6 for a vSwitch.
(Optional) Create an IPv6 gateway. For more information, see Create and manage an IPv6 gateway.
IPv6 gateways are available in the following editions: Free Edition, Enterprise Edition, and Enhanced Enterprise Edition. Different editions of IPv6 gateways have different capabilities. After you enable an IPv6 CIDR block for a VPC, the system automatically creates a Free Edition IPv6 gateway for the VPC. You can create IPv6 gateways of different editions based on your business requirements.
If you want to use an IPv6 address to communicate over the Internet, you must enable Internet bandwidth for the IPv6 gateway. For more information, see Enable and manage IPv6 Internet bandwidth.
Description
When you call the CreateContainerGroup operation to create an elastic container instance, you can use parameters such as Ipv6AddressCount to assign an IPv6 address to the elastic container instance. The following table describes these parameters. For more information, see CreateContainerGroup.
Parameter | Type | Example | Description |
Ipv6AddressCount | Integer | 1 | The number of IPv6 addresses. Set the value to 1. You can assign only one IPv6 address to an elastic container instance. |
Ipv6GatewayBandwidthEnable | Boolean | true | Specifies whether to enable IPv6 Internet communication for the elastic container instance. |
Ipv6GatewayBandwidth | Integer | 100 | The peak Internet bandwidth of the IPv6 address when the Ipv6GatewayBandwidthEnable parameter is set to true. Valid values:
The default value is the maximum value in the Internet bandwidth range of the IPv6 gateway. |