All Products
Search
Document Center

Elastic Container Instance:Assign an IPv6 address to an elastic container instance

Last Updated:Feb 26, 2024

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 pods:

  • You can assign only one IPv6 address to a pod.

  • All elastic container instances that you create by specifying number of vCPUs and memory size can be assigned IPv6 addresses. For elastic container instances that you create by specifying instance types of Elastic Compute Service (ECS), make sure that the ECS instance types that you specify support IPv6 addresses before you assign IPv6 addresses to elastic container instances. For information about whether an ECS instance type supports IPv6 addresses, see Overview of instance families.

Prerequisites

IPv6 CIDR blocks are enabled for the virtual private cloud (VPC) in which the pod resides and for the vSwitch to which the pod is connected. For more information, see Enable IPv6 for a VPC and Enable IPv6 for a vSwitch.

Description

When you call the CreateContainerGroup API 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 Internet access to the elastic container instance over IPv6 addresses.

Ipv6GatewayBandwidth

Integer

100

The maximum Internet bandwidth of the IPv6 address when the Ipv6GatewayBandwidthEnable parameter is set to true. Valid values:

  • If the billing method for the Internet bandwidth of the IPv6 gateway is pay-by-bandwidth, the Internet bandwidth of the IPv6 address ranges from 1 to 2,000 Mbit/s.

  • If the billing method for the Internet bandwidth of the IPv6 gateway is pay-by-traffic, the Internet bandwidth of the IPv6 address ranges from 1 to 1000 Mbit/s.

The default value is the maximum value in the bandwidth range of the Internet gateway.

After you create an elastic container instance, you can call the DescribeContainerGroups API operation to query the details of the instance. The IPv6 address of the instance is displayed in the Ipv6Address parameter.