This topic describes how to configure IPv6 addresses for Linux Elastic Compute Service (ECS) instances. IPv6 addresses can be manually or automatically configured. We recommend that you use an appropriate tool to automatically configure IPv6 addresses.
Automatically configure IPv6 addresses
The ecs-util-ipv6 tool can be used to configure IPv6 addresses for instances that are already assigned IPv6 addresses and clear IPv6 configurations for instances that are not assigned IPv6 addresses.
Series | Distribution | Download URL |
---|---|---|
Red Hat Enterprise Linux (RHEL) |
|
Download URL |
Debian |
|
Download URL |
SUSE Linux Enterprise Server (SLES) |
|
Download URL |
FreeBSD | FreeBSD 11 | Download URL |
- The ecs-util-ipv6 tool applies only to ECS instances located in virtual private clouds (VPCs) and depends on instance metadata. Before you use this tool, make sure that the network service is not disabled and that outbound access to 100.100.100.200 is allows on port 80. For more information, see Overview of ECS instance metadata.
- When the ecs-util-ipv6 tool runs, network interface controllers (NICs) and the network service are restarted. This may cause a brief network interruption. Proceed with caution.
chmod +x ./ecs-utils-ipv6
./ecs-utils-ipv6
If your instance is already assigned an IPv6 address, the IPv6 address is automatically configured. Otherwise, the existing IPv6 address configurations are automatically cleared.
ecs-utils-ipv6 --help # show usage
ecs-utils-ipv6 --version # show version
ecs-utils-ipv6 # auto config all dev ipv6
ecs-utils-ipv6 --static [dev] [ip6s] [prefix_len] [gw6] # config dev static ipv6
e.g. ecs-utils-ipv6 --static eth0
ecs-utils-ipv6 --static eth0 xxx::x1 64 xxx::x0
ecs-utils-ipv6 --static eth0 "xxx::x1 xxx:x2 xxx:x3" 64 xxx::x0
ecs-utils-ipv6 --enable # enable ipv6
ecs-utils-ipv6 --disable # disable ipv6
./ecs-utils-ipv6 #By default, no parameter settings are required. Multiple IPv6 addresses are automatically configured for multiple NICs.
./ecs-utils-ipv6 --enable #Enable IPv6.
./ecs-utils-ipv6 --disable #Disable IPv6.
./ecs-utils-ipv6 --static <dev> #Have an IPv6 address automatically configured for an NIC.
./ecs-utils-ipv6 --static <dev> <ip6s> <prefix_len> <gw6> #Manually configure one or more IPv6 addresses for NICs. Separate the addresses with spaces and enclose each address in double quotation marks (" ").
#!/bin/sh
install_dir=/usr/sbin
install_path="$install_dir"/ecs-utils-ipv6
if [ ! -f "$install_path" ]; then
tool_url="http://ecs-image-utils.oss-cn-hangzhou.aliyuncs.com/ipv6/rhel/ecs-utils-ipv6"
# download the tool
if ! wget "$tool_url" -O "$install_path"; then
echo "[Error] download tool failed, code $?"
exit "$?"
fi
fi
# chmod the tool
if ! chmod +x "$install_path"; then
echo "[Error] chmod tool failed, code $?"
exit "$?"
fi
# run the tool
"$install_path"
Manually configure IPv6 addresses for an instance that runs an Alibaba Cloud Linux 2 or 3 operating system
Perform the following steps to manually configure IPv6 addresses for an Alibaba Cloud Linux instance.
Manually configure IPv6 addresses for an instance that runs an operating system of another series
Perform the following steps to manually configure IPv6 addresses for an instance that runs an operating system of another series, such as CentOS, Debian, Ubuntu, or Fedora.