Configure DHCPv6 for Linux VMs

Caution

This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and planning accordingly. For more information, see the CentOS End Of Life guidance.

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, CentOS, and Oracle Linux versions 7.4 or higher, follow these steps:

  1. Edit the /etc/sysconfig/network file, and add the following parameter:

    NETWORKING_IPV6=yes
    
  2. Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file, and add the following two parameters:

    IPV6INIT=yes
    DHCPV6C=yes
    
  3. Renew the IPv6 address:

    sudo ifdown eth0 && sudo ifup eth0