Configure an IPv6 Address
Background Information
After assigning the public IPv6 address to your virtual machine instance at creation, the IPv6 will be effective by default. No manual configuration is required. If you allocate additional IPv6 addresses to your instances, you need to access the instance and configure the IPv6 to make it effective.
IPv6 Address Configuration
Configure the IPv6 addresses on your instances with the following images.
Debian 7
The assigned IPv6 address will take effect automatically but may be invalid after an instance reboot. Therefore, cloud-init's ability to modify network interface files in the /etc/network/interfaces.d directory must be disabled.
In the following example, default network interface configuration file is: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg.
Execute the following command to open the configuration file of network interface.
sudo vi /etc/cloud/cloud.cfg.d/99-disable-network-config.cfgConfigure the following information, save and exit.
network: {config: disabled}Execute the following command to open the configuration file of network interface.
sudo vi /etc/network/interfaces.d/50-cloud-initAppend the following information at the end.
iface eth0 inet6 dhcpAfter modification, save and exit.
Run the following command to reboot your instance.
sudo reboot
Ubuntu 24.04
The network configuration is typically managed by Netplan.
Netplan configuration files are located in
/etc/netplan/. The file might be named something like01-netcfg.yamlor50-cloud-init.yaml. Run the following command to open the Netplan configuration file.sudo vi /etc/netplan/01-netcfg.yamlAdd or modify the configuration. Here is an example.
network: version: 2 ethernets: eth0: dhcp4: no dhcp6: no addresses: - 2001:db8::1/64 - 2001:db8::2/64 gateway6: 2001:db8::ff nameservers: addresses: - 2001:4860:4860::8888 - 2001:4860:4860::8844Apply the Netplan configuration with the following command.
sudo netplan apply
CentOS 9
Configure DHCPv6
Run the following command to open the network interface configuration file. Replace
eth0with your actual network interface value.sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0Press
ito enter insert mode, and add the following configuration.IPV6INIT=yes DHCPV6C=yesPress
Escto exit edit mode. Type:wqand pressEnterto save and exit.Restart the instance to apply the configuration changes.
sudo reboot
Last updated