How to Enable IPv6 on Droplets

IP addresses let machines communicate across a network. DigitalOcean Droplets are assigned IPv4 addresses by default. Enabling IPv6 on a Droplet gives you access to its 16 additional IPv6 addresses.

You can enable IPv6 on a Droplet when you create it or after you create it.

If you enable IPv6 during Droplet creation, all the related configuration is done automatically. We recommend this option because it's faster and avoids manual configuration errors.

You can still enable private networking on an existing Droplet by manually configuring the interface.

Enable IPv6 During Droplet Creation

To create a Droplet with IPv6 enabled, open the Create menu from your DigitalOcean Control Panel and select Droplets.

The create menu

This takes you to the Create Droplet page. In the Additional Options section, check IPv6.

The additional options available during Droplet creation

When you've selected all your options, click the Create button at the bottom.

Once the Droplet is created, its IPv6 address is displayed in the header. To view more IPv6 information, including the public IPv6 address, gateway, and configurable address range, click the Droplet's name, then visit its Networking link in the side navigation.

At this point, your new address is ready for use.

Enable IPv6 on Existing Droplets

Your Droplet needs to be powered down to enable IPv6. This safest way to do this is by logging into your Droplet and using the shutdown command with the h flag:

sudo shutdown -h now

Once the Droplet is off, the next step is to enable IPv6 from the control panel. This gives you the address information you need to then configure it on the Droplet itself.

On the Droplets page, click the name of the Droplet, then click Networking in the side navigation. In the Public IPv6 network section, click Enable.

The Droplet Networking page with the IPv6 enable button highlighted

When you're done, click the OFF button to switch the Droplet back ON. The page will automatically update with the IPv6 network information.

Powering on the Droplet by clicking the On/Off switch in the control panel

When you enable IPv6 after the Droplet is created, you need to manually configure the IPv6 network on the Droplet itself as well. This involves adding information to the network configuration file to assign the static address and gateway address, disable automatic configuration, and add IPv6 nameservers.

The file you edit and the way you add information depends on which Linux distribution your Droplet is running.

On Ubuntu 18.04, you need to edit /etc/netplan/50-cloud-init.yaml to make the following changes:

  • In the eth0 stanza,, under addresses:, add a line for the Droplet's IPv6 address, substituting the Droplet's specific IPv6 address followed by the netmask value, /64.

  • In the eth0 stanza, add a new line for gateway6, substituting the gateway address from the Droplet's IPv6 networking page.

  • In the nameservers stanza, add two lines for IPv6 nameservers, 2001:4860:4860::8844 and 2001:4860:4860::8888.

The file will look like this when you're done:

version: 2
	- substitute_your_primary_ipv6_address/64
	gateway6: substitute_your_ipv6_gateway
	    macaddress: 5e:5x:5a:2m:8p:le
	    - 2001:4860:4860::8844
	    - 2001:4860:4860::8888
	    search: []
	set-name: eth0


Errors in your syntax can disrupt your networking and force you to use the Droplet console to restore connectivity, so check the file’s syntax before you apply the changes.

sudo netplan apply --debug

If there’s an error in the file, it will be printed to the screen. When the syntax is correct, the command will return you to the prompt with no output and apply the changes.

On Debian and Ubuntu 16.04, you need to edit /etc/network/interfaces.d/50-cloud-init.cfg. On Ubuntu 14.04, you need to edit /etc/network/interfaces.

Add the entire stanza below, substituting your Droplet's IPv6 address and gateway:

iface eth0 inet6 static
    address substitute_your_primary_ipv6_address
    netmask 64
    gateway substitue_your_ipv6_gateway
    autoconf 0
    dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888


Next, restart networking, which checks the configuration for errors and loads the network interface.

sudo systemctl restart networking

When the command is successful, it doesn't return output.

On CentOS and Fedora, you need to edit /etc/sysconfig/network-scripts/ifcfg-eth0.

Add the following block, substituting the IPv6 address and gateway for the Droplet.



Next, restart networking to check the configuration for errors and load the network interface.

sudo systemctl restart network

When the command is successful, it doesn't return output.

Finally, reboot the server to apply the changes.


Verify the Configuration

To use IPv6, it must be enabled and configured at both ends of a connection: where you’re connecting from (like your home or work network) and where you’re connecting to (like a Droplet). Not all ISPs offer IPv6 addresses for customers, so you may not be able to connect to an IPv6 address directly from your local machine.

To test the IPv6 configuration, try reaching the Google IPv6 name server using its IPv6 address from the Droplet:

ping6 2001:4860:4860::8888

If IPv6 is working correctly, you’ll see output like this, which means the Droplet can communicate across the Internet with other sites and servers that have IPv6 enabled.

PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=57 time=3.16 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=57 time=2.79 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=57 time=2.85 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=57 time=2.83 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=5 ttl=57 time=2.88 ms
To exit, press q.

If you see output like ping: sendmsg: Network is unreachable, make sure that you used ping6 and not ping. If you still can't connect, check the changes you made to the configuration file for errors, then reboot and test again.