Assign an IPv6 address to an ECS instance in an IPv6-enabled VPC, configure it on the OS, and enable public or private IPv6 communication.
IPv6 solves IPv4 address scarcity by providing a vast address space, eliminating address conflicts and barriers for devices to connect to the internet.
Limitations
Regions that support IPv6 Gateway
An IPv6 Gateway is a gateway for IPv6 traffic in a VPC. By default, an assigned IPv6 address provides only private network communication. You can enable public network communication by purchasing internet bandwidth for the IPv6 address through an IPv6 Gateway. For more information, see IPv6 Gateway.
Area | Regions |
Asia Pacific - China | China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Fuzhou - Local Region), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and China (Hong Kong) |
Asia Pacific - Others | Philippines (Manila), Singapore, Japan (Tokyo), South Korea (Seoul), Indonesia (Jakarta), Malaysia (Kuala Lumpur), and Thailand (Bangkok) |
Europe & Americas | US (Virginia), US (Silicon Valley), Germany (Frankfurt), UK (London), and Mexico |
Middle East | SAU (Riyadh - Partner Region) |
Unsupported ECS instance families
-
ic5 compute-intensive instance family
-
se1 memory-optimized instance family
-
d1 big data instance family
-
i2g and i1 local SSD-equipped instance families
-
hfc5 high-frequency compute-optimized and hfg5 high-frequency general-purpose instance families
-
ebmg5 general-purpose and ebmr5s memory-optimized network-enhanced ECS Bare Metal Instance families
-
xn4, n4, mn4, and e4 previous-generation burstable instance families
-
scch5 high-frequency Super Computing Cluster instance family
-
gn5 GPU-accelerated compute-optimized instance family
-
n1, n2, and e3 burstable instance families
-
sn2 and sn1 general-purpose instance families
IPv6 address limits per instance
The number of IPv6 addresses assignable to an ECS instance depends on the number of ENIs attachable to the instance and the number of IPv6 addresses assignable to each ENI.
-
The number of IPv6 addresses assignable to a single ENI depends on the instance family. See the Number of IPv6 addresses per ENI column in Instance families.
-
The number of ENIs attachable to a single instance is determined by the instance family. See the Elastic Network Interface column in Instance families.
Procedure
You can use one-click deployment to quickly complete the following operations.
Step 1: Enable IPv6 for VPC and vSwitch
Ensure that IPv6 is enabled for the VPC and vSwitch where your ECS instance is located. See Enable IPv6 for a VPC and Enable IPv6 for a vSwitch.


Step 2: Assign an IPv6 address
Assign an IPv6 address to an ECS instance for IPv6 communication with other instances or external networks.
Assign to existing instance
Go to ECS console - Instances.
In the upper-left corner of the page, select a region and resource group.
-
Find the target ECS instance and click its ID. Then, from the All Operations menu, choose .

-
In the Manage Secondary Private IP Address dialog box, under the IPv6 Supported section, click Add.
If you do not need to specify an IPv6 address, leave the IPv6 address field empty. The system automatically assigns an address.
-
Click OK.
Assign during creation
When creating an instance, note the following settings. For other configurations, see Create an instance by using the custom launch tab.
-
Networking: Select an IPv6-enabled VPC and vSwitch.
-
Instance: Click Select Instance Type, filter for IPv6 Supported instance types, and then select an instance type.


-
Networking: Click Elastic Network Interface | IPv6 (Optional), and then select Assign IPv6 Address Free of Charge.

After the address is assigned, you can view its details in the ECS console. See View IP addresses.
Step 3: Configure the IPv6 address
Configure the IPv6 address on the instance NIC so the operating system can recognize and use it.
-
Some images automatically configure and recognize IPv6 addresses. Check whether your instance's operating system has detected the IPv6 address:
Linux instances
-
Connect to the Linux instance.
-
Run
ip -6 addr showorifconfig.-
If the output shows one global unicast address and one link-local address as in the following figure, the IPv6 address is detected. Skip the remaining configuration steps. Otherwise, proceed.
-

Windows instances
-
Connect to the Windows instance.
-
Open the command-line tool and run
ipconfig.-
If the output shows one global unicast address and one link-local address as in the following figure, the IPv6 address is detected. Skip the remaining configuration steps. Otherwise, proceed.
-

-
-
Configure the IPv6 address.
ImportantAutomatic configuration requires Cloud Assistant. If your instance does not support Cloud Assistant or you prefer not to install it, configure the IPv6 address manually.
(Recommended) Automatic configuration
Prerequisites
-
The Cloud Assistant client is installed on the instance. If not, see Install the Cloud Assistant client.
-
This method applies only to the following operating systems: Alibaba Cloud Linux 2/3, CentOS 6/7/8, Red Hat 6/7, Anolis OS, Fedora, Ubuntu 14/16/18/20, Debian 8/9/10/11, SUSE 11/12/15, OpenSUSE 15/42, and FreeBSD 11.
ImportantThis process uses Cloud Assistant and may restart the NIC or network services, causing a temporary network interruption.
Procedure
-
Connect to the Linux instance.
-
Configure the IPv6 address:
NoteBy default, this command checks whether the
ecs-utils-ipv6plug-in is installed and up to date. If not, the system downloads and installs the latest version automatically.sudo acs-plugin-manager --exec --plugin=ecs-utils-ipv6
Manual configuration (Linux)
-
Connect to the Linux instance.
-
Run
ip addr | grep inet6orifconfig | grep inet6to check whether IPv6 is enabled.-
If no
inet6information is returned, IPv6 is disabled. Enable it as follows: -
If
inet6information is returned, IPv6 is enabled. Configure the IPv6 address.
-
-
Manual configuration (Windows)
-
Connect to the Windows instance.
-
Open the command-line tool and run
ipconfigto check whether IPv6 is enabled.-
If no
inet6information is returned, IPv6 is disabled. Enable it: -
If
inet6information is returned, IPv6 is enabled. Configure the IPv6 address.
-
-
Configure the IPv6 address.
-
On the instance details page, obtain the assigned IPv6 address.
-
-
-
-
(Conditional) This step applies only to Linux instances.
Check whether the multi-ENI configuration tool is installed:
ls /sbin/eni-ifscanIf the command returns a path as shown below, the tool is pre-installed. Modify the
eni-functionfile.NoteIf a Linux instance has the multi-ENI configuration tool pre-installed, the IPv6 NIC may not be detected automatically because the tool does not support IPv6 by default. The instance may fail to obtain an IPv6 address after a restart.

-
If the
ifconfigoripconfigcommand returns the result from Step 1, the configuration is successful.
The ECS instance can now communicate over its private IPv6 address. Test private connectivity as follows:
Step 4: Enable internet bandwidth for IPv6
By default, an IPv6 address provides only private network communication. To enable public access, purchase internet bandwidth for the IPv6 address.
-
Log on to the VPC console.
-
In the navigation pane on the left, choose .
- In the top navigation bar, select the region where the IPv6 gateway is deployed.
-
On the IPv6 Gateway page, find the IPv6 gateway that you want to manage based on the VPC ID of the instance and click the ID of the IPv6 gateway.
-
On the IPv6 Gateway details page, click the IPv6 Internet Bandwidth tab, find the target IPv6 address, and click Activate Internet Bandwidth in the Actions column.
-
On the IPv6 Internet Bandwidth (Pay-as-you-go) page, set the following parameters, click Buy Now, and complete the payment.
Parameter
Description
Traffic
Metering method for internet bandwidth.
Two methods are available: Pay-By-Bandwidth and Pay-By-Data-Transfer. Billing for IPv6 Gateway.
Bandwidth
Maximum bandwidth.
Billing Cycle
Billing cycle. Valid values: By Day and By Hour.
-
If the metering method is Pay-By-Bandwidth, the billing cycle is By Day.
-
If the metering method is Pay-By-Data-Transfer, the billing cycle is By Hour.
-
After you enable internet bandwidth for the IPv6 address, test public IPv6 connectivity:
To test IPv6 connectivity, both the client and server must support and be configured for IPv6.
ping -6 aliyun.com
If the system returns output similar to the following figure, the connection is normal.
In this example, aliyun.com supports IPv6. After your ECS instance is configured, you can access aliyun.com over IPv6.
More operations
Add IPv6 security group rules
IPv4 and IPv6 traffic are independent. Configure IPv6 security group rules if your current rules do not cover IPv6 traffic.
Delete an assigned IPv6 address
Delete an IPv6 address from an ECS instance when it is no longer needed. The IPv4 address remains unaffected.
Make sure that the instance is in the Running or Stopped state.
Procedure
In the upper-left corner of the page, select a region and resource group.
-
On the ENIs page, find the elastic network interface that is attached to the target instance and has an assigned IPv6 address. In the Operation column, click Manage Elastic Network Interface IPs.
-
In the Manage Elastic Network Interface IPs dialog box, click the
icon next to the IPv6 address that you want to delete. -
Click OK.
References
-
To remove public network access for an IPv6 address, Delete IPv6 internet bandwidth.
-
To manage IPv6 traffic within a VPC, Add and manage IPv6 routes in a route table.



