To implement IPv6 communication over the Internet or within a virtual private cloud (VPC), create an Elastic Compute Service (ECS) instance with IPv6 addresses in the VPC. This topic explains how ECS instances use IPv6 addresses for communication, the assignment and configuration of IPv6 addresses, and more.
Note
The scarcity of IPv4 addresses has led network engineers to spend considerable time and effort resolving issues such as address conflicts. IPv6 addresses are more abundant, allowing a wider variety of devices to connect to the Internet.
Limits
Regions supported by IPv6 gateway
Note
IPv6 Gateway serves as a gateway for IPv6 traffic within VPC. By default, IPv6 addresses are limited to private network communication. However, you can activate Internet bandwidth on the IPv6 Gateway, enabling these addresses to connect over the Internet. 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), and UK (London) |
Middle East | SAU (Riyadh - Partner Region)
Important The SAU (Riyadh - Partner Region) region is operated by a partner. |
ECS instance families that do not support IPv6
ic5, compute-intensive instance family
se1, memory-optimized instance family
d1, big data instance family
i2g, instance family with local SSDs, and i1, instance family with local SSDs
hfc5, compute-optimized instance family with high clock speeds, and hfg5, general-purpose instance family with high clock speeds
ebmg5, general-purpose ECS Bare Metal Instance family, and ebmr5s, network-enhanced memory-optimized ECS Bare Metal Instance family
xn4, n4, mn4, and e4, previous-generation shared instance families
scch5, SCC instance family with high clock speeds
gn5, GPU-accelerated compute-optimized instance family
n1, n2, and e3, shared instance families
sn2, general-purpose instance family, and sn1, general-purpose instance family
Configuration method
Note
Using the One-click Deployment feature, you can swiftly perform a range of operations.
Step 2: assign IPv6 addresses
Assign IPv6 addresses to ECS instances to enable communication with other instances or the Internet over IPv6.
Assign IPv6 addresses to existing instances
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
-
Select the created ECS instance. In the Operation column, choose .
-
In the Manage Secondary Private IP dialog box, assign an IPv6 address as prompted.
-
Click OK.
Assign IPv6 addresses when creating instances
When creating an instance, consider the following (for more configuration instructions, see Custom Purchase):
-
Network And Zone: Select a VPC and vSwitch with IPv6 enabled.
-
Instance: Filter instance types that support IPv6 and select an instance type.

-
Bandwidth And Security Group: Click Elastic Network Interface | Ipv6 (optional) and select Assign Ipv6 Address For Free.

After assigning the IPv6 address, you can view the IP address details in the ECS console. For more information, see View IP Address.
Step 3: configure IPv6 addresses
Configure the IPv6 address on the network interface card (NIC) of the ECS instance for the operating system to recognize and use the IPv6 address.
-
Some images support automatic configuration and recognition of IPv6 addresses. Check if the operating system of your ECS instance recognizes IPv6 addresses by following these steps.
Linux instances
-
Connect to the Linux instance remotely.
For more information, see Log on to a Linux instance by using the SSH protocol in Workbench.
-
Run the ip -6 addr show
or ifconfig
command.
-
If the returned information includes a global unicast address and a link-local address, the IPv6 address is successfully recognized, and you can skip IPv6 configuration. Otherwise, proceed with the following steps.

Windows instances
-
Connect to the Windows instance remotely.
For more information, see Log on to a Windows instance by using password authentication.
-
Open the command line tool and run the ipconfig
command.
-
If the returned information includes a global unicast address and a link-local address, the IPv6 address is successfully recognized, and you can skip IPv6 configuration. Otherwise, continue with the following steps.

-
Configure the IPv6 address.
Important
To automatically configure an IPv6 address, Cloud Assistant must be installed. If Cloud Assistant is not supported or installation is inconvenient, manually configure the IPv6 address.
(Recommended) Automatically configure IPv6 addresses
Prerequisites
-
The instance has Cloud Assistant installed. If not, see Install Cloud Assistant Agent.
-
This method is applicable 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.
Important
During configuration, Cloud Assistant is used, and NICs and the network service are restarted, which may cause a brief network interruption. Proceed with caution.
Procedure
-
Connect to the Linux instance remotely.
For more information, see Log on to a Linux instance by using the SSH protocol in Workbench.
-
Run the following command to configure the IPv6 address.
Note
By default, the system checks if the ecs-utils-ipv6
plug-in is installed locally and if it is the latest version. If not, the system automatically downloads and installs the latest version. Ensure the ECS instance can access the Internet.
sudo acs-plugin-manager --exec --plugin=ecs-utils-ipv6
Manual configuration (Linux)
-
Connect to the Linux instance remotely.
For more information, see Log on to a Linux instance by using the SSH protocol in Workbench.
-
Run the ip addr | grep inet6
or ifconfig | grep inet6
command to check if IPv6 is enabled on the instance.
-
If no inet6
related content is returned, IPv6 is not enabled. Enable IPv6.
How to Enable IPv6 Service?
Alibaba Cloud Linux 2/3
-
To modify the /etc/sysctl.conf
configuration file, run the following command:
vi /etc/sysctl.conf
-
Press i
to enter edit mode, locate the following content, and change the value at the end of the line from 1
to 0
.
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
-
To enable IPv6 for a specific network interface, modify the information as shown below.
net.ipv6.conf.eth0.disable_ipv6 = 0
-
Once you've finished modifying, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
Check if the configuration information in /etc/sysctl.conf
differs from that in the /etc/sysctl.conf
file in initramfs by running the following command:
diff -u /etc/sysctl.conf <(lsinitrd -f /etc/sysctl.conf)
Note
Alibaba Cloud Linux 2 has an initramfs configured. If the /etc/sysctl.conf
file in initramfs differs from the IPv6 configuration file /etc/sysctl.conf
, the system may apply new configurations that conflict with your desired settings.
-
If the two configuration files differ, regenerate initramfs
by running the following command:
sudo dracut -v -f
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
-
Verify whether IPv6 is successfully enabled by running the ip addr | grep inet6
or ifconfig | grep inet6
command.
If the system returns inet6
related content, IPv6 has been successfully enabled.
CentOS 6/7
-
To modify the /etc/modprobe.d/disable_ipv6.conf
configuration file, run the following command:
vi /etc/modprobe.d/disable_ipv6.conf
-
Enter edit mode by pressing i
and change options ipv6 disable=1
to options ipv6 disable=0
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To modify the /etc/sysconfig/network
configuration file, run the following command:
vi /etc/sysconfig/network
-
Enter edit mode by pressing i
and change NETWORKING_IPV6=no
to NETWORKING_IPV6=yes
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
(Optional) To reload the IPv6 module, run the following commands in sequence:
Note
This step is mandatory for CentOS 6; otherwise, it can be skipped.
modprobe ipv6 -r
modprobe ipv6
lsmod | grep ipv6
If the system returns the following content, the IPv6 module has been successfully loaded.
ipv6 xxxxx 8
Note
The parameter value on the third line of the returned content must not be 0; if it is, you must re-enable IPv6.
-
To modify the /etc/sysctl.conf
configuration file, run the following command:
vi /etc/sysctl.conf
-
Enter edit mode by pressing i
, locate the following content, and change the value at the end of the line from 1
to 0
.
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To apply the new configurations, run the following command:
sudo sysctl -p
Debian 8/9
-
To modify the /etc/default/grub
configuration file, run the following command:
vi /etc/default/grub
-
Enter edit mode by pressing i
and delete ipv6.disable=1
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To modify the /boot/grub/grub.cfg
configuration file, run the following command:
vi /boot/grub/grub.cfg
-
Enter edit mode by pressing i
and delete ipv6.disable=1
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
Restart the Linux instance for the changes to take effect. For more information, see Restart an instance.
-
To modify the /etc/sysctl.conf
configuration file, run the following command:
vi /etc/sysctl.conf
-
Enter edit mode by pressing i
, locate the following content, and change the value at the end of the line from 1
to 0
.
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To apply the new configurations, run the following command:
sudo sysctl -p
Ubuntu 14/16, openSUSE 42
-
To modify the /etc/sysctl.conf
configuration file, run the following command:
vi /etc/sysctl.conf
-
Enter edit mode by pressing i
, locate the following content, and change the value at the end of the line from 1
to 0
.
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To apply the new configurations, run the following command:
sysctl -p
FreeBSD 11
-
To modify the /etc/rc.conf
configuration file, run the following command:
vi /etc/rc.conf
-
Enter edit mode by pressing i
and add ipv6_activate_all_interfaces="YES"
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
Restart the network for the configurations to take effect by running the following command:
/etc/netstart restart
SUSE 11/12
-
To modify the /etc/modprobe.d/50-ipv6.conf
configuration file, run the following command:
vi /etc/modprobe.d/50-ipv6.conf
-
Enter edit mode by pressing i
and delete install ipv6 /bin/true
.
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To modify the /etc/sysctl.conf
configuration file, run the following command:
vi /etc/sysctl.conf
-
Enter edit mode by pressing i
, locate the following content, and change the value at the end of the line from 1
to 0
.
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
-
After completing the changes, press Esc
to exit edit mode, type :wq
, and press Enter to save and exit.
-
To apply the new configurations, run the following command:
sysctl -p
If the inet6
related content is returned, the instance is IPv6 enabled. You can then configure the IPv6 address.
-
Configure the IPv6 address.
Alibaba Cloud Linux 2/3, CentOS 6/7, Red Hat 6/7
-
Run the following command to modify the NIC configuration file.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
eth0
: Replace with the actual NIC interface name. After the modification, save and exit.
-
Press i
to enter edit mode and add the following configurations based on actual information.
DHCPV6C=yes
IPV6INIT=yes
-
After the modification, press Esc
to exit edit mode, enter :wq
, and press Enter to save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
CentOS 8
-
Check whether the NIC configuration file contains IPV6INIT=yes
and DHCPV6C=yes
. If so, proceed to the next step. If not, manually add them.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
eth0
is the NIC identifier. Change it to the actual identifier. After the modification, save and exit.
-
Disable the ability of cloud-init to modify NIC files in the /etc/sysconfig/network-scripts/
directory.
Note
Assigned IPv6 addresses do not need manual configuration, but may be lost upon instance restart. Therefore, disabling cloud-init's ability to modify NIC files is necessary.
-
Run vi /etc/cloud/cloud.cfg
to open the NIC configuration file.
vi /etc/cloud/cloud.cfg
-
Add the following information before the Example datasource config
content:
network:
config: disabled
After the modification, save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
Debian 8/9/10/11, Ubuntu 16
-
Run vi /etc/network/interfaces
to open the NIC configuration file and add the following content based on actual information:
iface eth0 inet6 dhcp
eth0
: Replace with the actual NIC interface name. After the modification, save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
Ubuntu 18/20
-
Disable the ability of cloud-init to modify NIC files in the /etc/sysconfig/network-scripts/
directory.
Note
Assigned IPv6 addresses do not need manual configuration, but may be lost upon instance restart. Therefore, disabling cloud-init's ability to modify NIC files is necessary.
-
Run vi /etc/cloud/cloud.cfg
to open the NIC configuration file.
vi /etc/cloud/cloud.cfg
-
Add the following information before the Example datasource config
content:
network:
config: disabled
After the modification, save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
Ubuntu 14
-
Run vi /etc/network/interfaces
to open the NIC configuration file and add the following content based on actual information:
iface eth0 inet6 dhcp
eth0
: Replace with the actual NIC interface name. After the modification, save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
FreeBSD 11
-
Run vi /etc/rc.conf
to open the NIC configuration file and add the following content based on actual information:
ipv6_enable="YES"
ipv6_ifconfig_vtnet0="<IPv6 address> <subnet prefix length>"
vtnet0
: Replace with the actual NIC interface name. After the modification, save and exit.
-
Continue to modify the following information in the file. After the modification, save and exit.
ip6addrctl_enable="YES"
ipv6_activate_all_interfaces="YES"
ipv6_network_interfaces="auto"
After the modification, the configuration file contains the following content:
hostname="Aliyun"
sshd_enable="YES"
dumpdev="NO"
ipv6_enable="YES"
ip6addrctl_enable="YES"
ip6addrctl_policy="ipv4_prefer"
ipv6_activate_all_interfaces="YES"
ipv6_network_interfaces="auto"
ifconfig_lo0="inet 127.0.0.1 netmask 255.0.0.0"
ifconfig_vtnet0="inet 192.168.XX.XX netmask 255.255.255.0"
ipv6_ifconfig_vtnet0="2001:XXXX:4:4:4:4:4:4 prefixlen 64"
defaultrouter="192.168.XX.XX"
hostname="freebsd"
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
Anolis OS 7.9/8.4, CentOS Stream, Fedora
-
Check whether the NIC configuration file contains IPV6INIT=yes
and DHCPV6C=yes
. If so, no further operations are required. If not, manually add them.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
eth0
: Replace with the actual NIC interface name. After the modification, save and exit.
-
Restart the ECS instance for the configurations to take effect. For more information, see Restart an instance.
Manually configure (Windows)
-
Connect to the Windows instance remotely.
For more information, see Log on to a Windows instance by using password authentication.
-
Open the command line tool and run the ipconfig
command to check if IPv6 is enabled on the instance.
-
If no inet6
related content is returned, IPv6 is not enabled. Proceed to enable IPv6.
How to Enable IPv6
-
Select .
-
Click the current network connection name to open the status interface, then click Properties.
-
Select Internet Protocol Version 6 (TCP/IPv6).
-
For Windows Server 2008/2012/2016/2019/2022, perform the following:
-
Check if the IPv6 option is selected. If not, select it and click OK.
-
For Windows Server 2003, perform the following:
-
Perform different operations based on the availability of the IPv6 option.
-
If the IPv6 option is available, select Internet Protocol Version 6 (TCP/IPv6) and click OK.
-
If the IPv6 option is not available:
-
On the Local Area Connection Properties page, click Install, and on the Network Component Type page, click .
-
On the Select Network Protocol page, select to complete the installation.
-
Select Internet Protocol Version 6 (TCP/IPv6) and click OK.
-
If inet6
related content is returned, IPv6 is enabled. Proceed to configure the IPv6 address.
-
Configure the IPv6 address.
-
On the Instance Details page, retrieve the generated IPv6 address.
-
Configure the IPv6 Address
-
For Windows Server 2008/2012/2016, perform the following:
-
Select .
-
Click the current network connection name to open the status interface, then click Properties.
-
Select .
-
Select Use The Following IPv6 Address, enter the IPv6 address, subnet prefix length, and IPv6 gateway, and click OK.
-
(Optional) To bind multiple IPv6 addresses, click Advanced on the Internet Protocol Version 6 (TCP/IP) Properties page to access the Advanced Settings page. Then, click Add to perform batch processing. Once the operation is complete, click OK .
-
For Windows Server 2003, perform the following:
-
Select and note the current network connection name, for example, Local Area Connection 2.
-
On the Windows desktop, press Win+R
to open the Run dialog box, enter the cmd
command, and click OK to open the command line tool.
-
Add an IPv6 address by running the following command:
-
To add a single IPv6 address, run the following command:
netsh interface ipv6 add address "Local Area Connection 2" <IPv6 address>
-
To add multiple IPv6 addresses, run these commands:
netsh interface ipv6 add address "Local Area Connection 2" <IPv6 address 1>
netsh interface ipv6 add address "Local Area Connection 2" <IPv6 address 2>
-
Add the default route by running the following command:
netsh interface ipv6 add route ::/0 "Local Area Connection 2" <IPv6 gateway>
-
(Conditionally required) If your ECS instance is running a Linux operating system, you need to perform this step; otherwise, skip it.
Execute the command below to check if the multi-NIC configuration tool is installed on the instance.
ls /sbin/eni-ifscan
If the information returned matches the following image, the multi-NIC configuration tool is pre-installed, and you will need to modify the eni-function
file.
Note
When the multi-NIC configuration tool is pre-installed on a Linux instance, the NICs may not automatically recognize IPv6 addresses, preventing the system from obtaining IPv6 addresses after a restart.

Modifying the eni-function
file
-
Use the following command to edit the eni-function
file.
vim /etc/eni_utils/eni-function
-
Press i
to enter edit mode. Change IPV6INIT=no
to IPV6INIT=yes
and add DHCPV6C=yes
. Save and exit after making the changes.

Verify the configuration's success by ensuring that the ifconfig
or ipconfig
command yields the expected results as outlined in Step 1.
At this stage, the ECS instance is capable of communicating via the IPv6 private network. To test the private network connectivity, proceed as follows.
Test Private Network Connectivity
Note Before testing the network connectivity of the IPv6 address, ensure that both the server and client support IPv6 and have IPv6 addresses configured. In this example, ECS01 and ECS02 must have IP addresses assigned.
Run the ping6 <ECS02 IPv6 private IP>
command on the ECS01 instance to ping6
the ECS02 instance's IPv6 address and verify the private network communication is functioning properly.
If ECS01 receives echo reply packets, the connection is established, indicating that the IPv6 private network communication between ECS01 and ECS02 is functioning properly. 
Run the ping6
command on the ECS02 instance to ping the IPv6 address of the ECS01 instance and test whether the private network communication is normal.ping
If ECS02 receives echo reply packets, the connection is established, confirming that the IPv6 private network communication between ECS02 and ECS01 is normal. 
Step 4: Enable IPv6 Internet bandwidth
By default, an ECS instance's IPv6 address can only communicate within private networks. To enable access to and from the Internet via the IPv6 address, you must activate IPv6 Internet bandwidth by following these steps.
-
Log on to the VPC console.
-
In the left-side navigation pane, choose .
- In the top navigation bar, select the region where the IPv6 gateway is deployed.
-
On the IPv6 Gateway page, locate the IPv6 gateway using the VPC ID of the instance, and then click the IPv6 gateway ID.
On the details page of the IPv6 gateway, click the IPv6 Internet Bandwidth tab, find the IPv6 address for which you want to enable Internet bandwidth, and then click Activate Internet Bandwidth in the Actions column.
On the IPv6 Internet Bandwidth (PostPay) page, specify the parameters described in the following table, click Buy Now, and then complete the payment.
Parameter | Description |
Traffic | Select a metering method for the Internet bandwidth. Valid values: Pay-By-Bandwidth and Pay-By-Data-Transfer. For more information, see Billing. |
Bandwidth | Specify a maximum value for the Internet bandwidth. |
Billing cycle | Select a billing cycle for the Internet bandwidth. Valid values: Day (By Day) and Hour (By Hour). If you set Traffic to Pay-By-Bandwidth, you can select only Day (By Day). If you set Traffic to Pay-By-Data-Transfer, you can select only Hour (By Hour).
|
Once IPv6 Internet bandwidth is enabled, you can test the IPv6 Internet connectivity.
Note
Ensure that both the server and client support IPv6 and are configured with IPv6 addresses when testing the network connectivity.
ping -6 aliyun.com
If the system returns the information as shown in the following figure, the network connection is normal. 
Note
In this example, the aliyun.com website supports IPv6. Once your ECS instance is configured, you can access the aliyun.com website over IPv6 from the instance.
Other operations
Add IPv6 security group rules
Services assigned IPv4 addresses cannot communicate with those assigned IPv6 addresses. If your current security group rules do not support IPv6 services, you must configure IPv6 security group rules for your ECS instances.
How to Add IPv6 Security Group Rules
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
-
Find the target security group and click Manage Rules in the Actions column.
-
On the Security Group Details page, find the Access Rule section and select Inbound or Outbound.
-
Add security group rules. For more information, see Add Security Group Rules.
Note
You must set the Authorization Object to an IPv6 CIDR block, such as 2001:db8:1234:1a00::***
. For more information about security group rules, see Security Group Rules.
Delete assigned IPv6 addresses
If your ECS instance no longer requires an IPv6 address, you can delete it. Even after the IPv6 address is removed, the instance will continue to operate using its IPv4 address. This section explains the process of deleting an IPv6 address through the ECS console.
Important
Ensure that the instance is either in the Running or Stopped state.
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
-
On the Elastic Network Interfaces page, select the elastic network interface associated with the target instance and assigned an IPv6 address. Then click Manage ENI IP in the Actions column.
-
In the Manage ENI IP dialog box, click the IPv6 Address
icon next to the information.
-
Click OK.