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-clientpackage, 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.conffile, 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: trueis reflected under the required interface, as shown by the following sample:
 -  network:
     version: 2
     ethernets:
         eth0:
             dhcp4: true
             dhcp6: true
             match:
                  driver: hv_netvsc
             set-name: eth0
 
- Save the file and reboot. 
- Use - ifconfigto verify virtual machine received IPv6 address.
 - If - ifconfigisn't installed, run the following commands:
 - sudo apt update
sudo apt install net-tools
 - 
  
 
All supported Debian 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 Debian image, follow these steps:
- 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: - [Match]
eth0
[Network]
DHCP=ipv6
 
- Renew the IPv6 address: - sudo systemctl restart systemd-networkd