Some of the Linux virtual-machine images in the Azure Marketplace don't have Dynamic Host Configuration Protocol version 6 (DHCPv6) configured by default. To support IPv6, DHCPv6 must be configured in the Linux OS distribution that you're using. The various Linux distributions configure DHCPv6 in various ways because they use different packages.
Note
Recent SUSE Linux and CoreOS images in the Azure Marketplace have been pre-configured with DHCPv6. No additional changes are required when you use these images.
This document describes how to enable DHCPv6 so that your Linux virtual machine obtains an IPv6 address.
Warning
By improperly editing network configuration files, you can lose network access to your VM. We recommended that you test your configuration changes on non-production systems. The instructions in this article have been tested on the latest versions of the Linux images in the Azure Marketplace. For more detailed instructions, consult the documentation for your own version of Linux.
For RHEL and Oracle Linux versions 7.4 or higher, follow these steps:
Edit the /etc/sysconfig/network file, and add the following parameter:
NETWORKING_IPV6=yes
Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file, and add the following two parameters:
IPV6INIT=yes
DHCPV6C=yes
Renew the IPv6 address:
sudo ifdown eth0 && sudo ifup eth0
Recent SUSE Linux Enterprise Server (SLES) and openSUSE images in Azure have been preconfigured with DHCPv6. No other changes are required when you use these images. If you have a VM that's based on an older or custom SUSE image, use one of the following procedures to configure DHCPv6.
OpenSuSE 13 and SLES 11
Install the dhcp-client package, if needed:
sudo zypper install dhcp-client
Edit the /etc/sysconfig/network/ifcfg-eth0 file, and add the following parameter:
DHCLIENT6_MODE='managed'
Renew the IPv6 address:
sudo ifdown eth0 && sudo ifup eth0
OpenSUSE Leap and SLES 12
For openSUSE Leap and SLES 12, follow these steps:
Edit the /etc/sysconfig/network/ifcfg-eth0 file, and replace the #BOOTPROTO='dhcp4' parameter with the following value:
BOOTPROTO='dhcp'
To the /etc/sysconfig/network/ifcfg-eth0 file, add the following parameter:
DHCLIENT6_MODE='managed'
Renew the IPv6 address:
sudo ifdown eth0 && sudo ifup eth0
For Ubuntu versions 17.10 or higher, follow these steps:
Edit the /etc/dhcp/dhclient.conf file, and add the following line:
timeout 10;
Create a new file in the cloud.cfg.d folder that retains your configuration through reboots. The information in this file will override the default NETPLAN config (in YAML configuration files at this location: /etc/netplan/*.yaml).
Create a /etc/cloud/cloud.config.d/91-azure-network.cfg file. Ensure that dhcp6: true is reflected under the required interface, as shown by the following sample:
Use ifconfig to verify virtual machine received IPv6 address.
If ifconfig isn't installed, run the following commands:
sudo apt update
sudo apt install net-tools
Edit the /etc/dhcp/dhclient6.conf file, and add the following line:
timeout 10;
Edit the /etc/network/interfaces file, and add the following configuration:
iface eth0 inet6 auto
up sleep 5
up dhclient -1 -6 -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhcp/dhclient6.eth0.leases -v eth0 || true
Renew the IPv6 address:
sudo ifdown eth0 && sudo ifup eth0
Recent CoreOS images in Azure have been preconfigured with DHCPv6. No other changes are required when you use these images. If you have a VM based on an older or custom CoreOS image, follow these steps:
Edit the /etc/systemd/network/10_dhcp.network file: