IPv6 addresses are used to deal with IPv4 address exhaustion. If an ECS uses an IPv4 address, the ECS can run in dual-stack mode after IPv6 is enabled for it. Then, the ECS will have two IP addresses to access the intranet and Internet: an IPv4 address and an IPv6 address.
In some cases, an ECS cannot dynamically acquire an IPv6 address even if it meets all the requirements in Constraints. You need to configure the ECS to dynamically acquire IPv6 addresses. For public images:
If IPv6 is not enabled, enable it by referring to Enabling IPv6 for an ECS. Once enabled, IPv6 cannot be disabled.
If you use a private image from a CentOS 6.x or Debian ECS with IPv6 auto-assignment enabled to create an ECS in a non-IPv6 environment, the ECS may experience slow startup due to an IPv6 address assignment timeout. You can set the timeout duration for assigning IPv6 addresses by referring to Setting the Timeout Duration for IPv6 Address Assignment.
OS | Auto/Manual | Reference |
|---|---|---|
Windows Server 2012 | Auto | |
Windows Server 2008 | Auto | |
Linux | Auto (recommended) | |
Linux | Manual |
After IPv6 is enabled on the subnet where the ECS works, an IPv6 CIDR block is automatically assigned to the subnet. IPv6 cannot be disabled once it is enabled.
The Subnets page is displayed.
The subnet details page is displayed.
Run the following command in the CMD window:
ipconfig
Figure 1 Querying the IPv6 address

Figure 2 Link-local IPv6 address

Figure 3 IPv6 disabled

By default, dynamic IPv6 address assignment is enabled for Windows public images, as shown in Figure 1. No additional configuration is required.
Figure 4 Ethernet connection

Figure 5 Configuring dynamic IPv6 address assignment

Figure 6 Configuring an IPv6 address and a DNS server address

For Windows Server 2012, run the following command in PowerShell or CMD:
Set-NetIPv6Protocol -RandomizeIdentifiers disabled
Run the following command in the CMD window:
ipconfig
Figure 7 Querying the IPv6 address

Figure 8 Link-local IPv6 address

Figure 9 IPv6 disabled

By default, dynamic IPv6 address assignment is enabled for Windows public images, as shown in Figure 7. No additional configuration is required.
Figure 10 Configuring dynamic IPv6 address assignment

Figure 11 Enabling and configuring IPv6

Figure 12 Adding the protocol

Figure 13 Network protocols

For Windows Server 2008, run the following command in PowerShell or CMD:
netsh interface ipv6 set global randomizeidentifiers=disable
Disable the local connection and then enable it again.
To disable the local connection, choose Start > Control Panel > Network and Internet > Network and Sharing Center > Change Adapter Options. Right-click the local connection and choose Disable from the shortcut menu.
To enable the local connection, choose Start > Control Panel > Network and Internet > Network and Sharing Center > Change Adapter Options. Right-click the local connection and choose Enable from the shortcut menu.
The ipv6-setup-xxx tool can be used to enable Linux OSs to automatically acquire IPv6 addresses. xxx indicates a tool, which can be rhel or debian.
You can also enable dynamic IPv6 address assignment by following the instructions in Linux (Manually Enabling Dynamic Assignment of IPv6 Addresses).
ip addr
Figure 14 IPv6 disabled

Figure 15 IPv6 enabled

Figure 16 IPv6 enabled and an IPv6 address assigned

IPv6 is enabled for Linux public images by default, as shown in Figure 15.
sysctl -a | grep ipv6
modprobe ipv6
net.ipv6.conf.all.disable_ipv6=0
sysctl -p
ipv6-setup-xxx modifies the configuration file of a NIC to enable dynamic IPv6 address assignment or adds such a configuration file for a NIC, and then restarts the NIC or network service.
Contact the administrator to obtain the download paths of ipv6-setup-rhel and ipv6-setup-debian.
chmod +x ipv6-setup-xxx
./ipv6-setup-xxx --dev [dev]
Example:
./ipv6-setup-xxx --dev eth0
If you use a private image from a CentOS 6.x or Debian ECS with IPv6 auto-assignment enabled to create an ECS in a non-IPv6 environment, the ECS may experience slow startup due to an IPv6 address assignment timeout. You can set the timeout duration for assigning IPv6 addresses to 30s by referring to Setting the Timeout Duration for IPv6 Address Assignment and try to create a new private image again.
ip addr
Figure 17 IPv6 disabled

Figure 18 IPv6 enabled

Figure 19 IPv6 enabled and an IPv6 address assigned

IPv6 is enabled for Linux public images by default, as shown in Figure 18.
sysctl -a | grep ipv6
modprobe ipv6
net.ipv6.conf.all.disable_ipv6=0
sysctl -p
cd /etc/netplan
ls
Figure 20 Configuration file name

vi 01-network-manager-all.yaml
ethernets:eth0:dhcp6: true
Figure 21 Edited configuration file

Save the changes and exit.
sudo netplan apply
cd /etc/netplan
ls
Figure 22 Configuration file name

vi 01-netcfg.yaml
ethernets:eth0:dhcp6: true
Figure 23 Edited configuration file

Save the changes and exit.
sudo netplan apply
vi /etc/NetworkManager/NetworkManager.conf
[main]plugins=ifupdown,keyfiledhcp=dhclient[ifupdown]managed=true[device]wifi.scan-rand-mac-address=no
Figure 24 Modification result

systemctl restart NetworkManager
auto loiface lo inet loopbackauto eth0iface eth0 inet dhcpiface eth0 inet6 dhcppre-up sleep 3
auto eth1iface eth1 inet dhcpiface eth1 inet6 dhcppre-up sleep 3
service networking restart
If no IPv6 address is assigned after the NICs are brought down and up, you can run this command to restart the network.
Add the following configuration items to the file:
IPV6INIT=yesDHCPV6C=yes
NETWORKING_IPV6=yes
Add the following configuration items to the file:
IPV6INIT=yesDHCPV6C=yes
In CentOS 6.3, dhcpv6-client requests are filtered by ip6tables by default. So, you also need to add a rule allowing the dhcpv6-client request to the ip6tables file.
ip6tables -A INPUT -m state --state NEW -m udp -p udp --dport 546 -d fe80::/64 -j ACCEPT
service ip6tables save
Figure 25 Example command

nmcli con
Figure 26 Querying NIC information

nmcli con modify "Wired connection 1" ipv6.addr-gen-mode eui64
The NIC information varies depending on the CentOS series. In the command, Wired connection 1 needs to be replaced with the value in the NAME column of the queried NIC information.
ifdown eth1
ifup eth1
service network restart
systemctl restart NetworkManager
SUSE 11 SP4 does not support dynamic IPv6 address assignment.
No additional configuration is required for SUSE 12 SP1 or SUSE 12 SP2.
No additional configuration is required for openSUSE 13.2 or openSUSE 42.2.
No additional configuration is required for CoreOS 10.10.5.
If you use a private image from a CentOS 6.x or Debian ECS with IPv6 auto-assignment enabled to create an ECS in a non-IPv6 environment, the ECS may experience slow startup due to an IPv6 address assignment timeout. You can set the timeout duration for assigning IPv6 addresses to 30s and try to create a new private image again.
vi /etc/dhcp/dhclient.conf
timeout 30;
vi /etc/init.d/networking
Figure 27 Modification 1

Figure 28 Modification 2

vi /lib/systemd/system/networking.service.d/network-pre.conf
[Service]TimeoutStartSec=30
vi /etc/system/system/network-online.target.wants/networking.service