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.
Enabling IPv6 during Droplet creation automatically configures the Droplet’s network interfaces. We recommend this option because it’s faster and avoids manual configuration errors.
You can still enable IPv6 on an existing Droplet by manually configuring its network interface.
You can enable IPv6 on Droplets during creation by setting the --enable-ipv6
flag to true
when using the doctl compute droplet create
command.
You can enable IPv6 on Droplets during creation by setting the ipv6
field to true
when using the Droplet creation call.
To create a Droplet with IPv6 enabled, open the Create menu from your DigitalOcean Control Panel and select Droplets.
On the Create Droplet page, in the Advanced Options section, check the box next to Enable IPv6.
When you’ve selected all of your options, click the Create Droplet button at the bottom.
Once you’ve created the Droplet, the header displays the Droplet’s IPv6 address. To view more IPv6 information, including the public IPv6 address, gateway address, and configurable address range, click the Droplet’s name, then click Networking in the side menu.
At this point, your new IPv6 address is ready for use.
You need to power down your Droplet to enable IPv6. To safely do this, log into your Droplet and use the shutdown command with the -h
flag, which instructs the system to shut down and then halt:
sudo shutdown -h now
Once the Droplet is off, the next step is to enable IPv6 from the control panel. This assigns IPv6 address information to the Droplet that you need to configure the Droplet’s network interface.
On the Droplets page, click the name of the Droplet, then click Networking in the side menu. In the Public Network section, click Enable. This assigns an IPv6 address to the Droplet.
Once enabled, click the OFF button to switch the Droplet back ON. The page automatically updates with the IPv6 network information.
When you enable IPv6 on an existing Droplet, you need to manually configure the IPv6 network interface on the Droplet itself. This involves adding information to the Droplet’s network configuration file, including the Droplet’s static IPv6 address, gateway address, IPv6 name servers, and disabling its automatic network configuration.
Click on Console to access your Droplet directly. The file you edit and the way you add information depends on which Linux distribution your Droplet is running.
On Ubuntu 20.04+ and Debian 12, open the /etc/netplan/50-cloud-init.yaml
configuration file in a text editor and make the following changes:
In the eth0
stanza, under addresses:
, add the Droplet’s IPv6 address on a new line followed by the netmask value, /64
.
In the eth0
stanza, under routes
, add a new gateway connection stanza as seen in the following example, substituting the gateway address from the Droplet’s IPv6 networking page.
The file looks like this when you’re done:
network:
version: 2
ethernets:
eth0:
accept-ra: false
addresses:
- substitute_your_primary_ipv6_address/64
- 174.138.74.145/20
- 10.17.0.6/16
match:
macaddress: f5:7c:7f:da:c3:e6
mtu: 1500
nameservers:
addresses:
- 67.207.67.3
- 67.207.67.2
search: []
routes:
- to: ::/0
via: substitute_your_ipv6_gateway
- to: 0.0.0.0/0
via: 174.138.64.1
set-name: eth0
To locate your Droplet’s IPv6 address and gateway address in the control panel, click Droplets, then click the Droplet’s name from the list. From the Droplet’s page, click Networking in the side menu. The Public Network section lists your Droplet’s IPv6 information.
Once you’ve edited and saved the file, run the following command to check the configuration’s syntax and temporarily apply the network changes:
sudo netplan apply --debug
On Ubuntu 18.04, open the /etc/netplan/50-cloud-init.yaml
configuration file in a text editor and make the following changes:
In the eth0
stanza, under addresses:
, add the Droplet’s IPv6 address on a new line followed by the netmask value, /64
.
In the eth0
stanza, on a new line, add gateway6
and the gateway address from the Droplet’s IPv6 networking page.
In the nameservers
stanza, add two lines for IPv6 name servers, 2001:4860:4860::8844
and 2001:4860:4860::8888
.
The file looks like this when you’re done:
network:
version: 2
ethernets:
eth0:
addresses:
- substitute_your_primary_ipv6_address/64
- 203.0.113.213/20
- 192.0.2.11/16
gateway4: 206.189.208.1
gateway6: substitute_your_ipv6_gateway
match:
macaddress: 5e:5x:5a:2m:8p:le
nameservers:
addresses:
- 67.207.67.2
- 67.207.67.3
- 2001:4860:4860::8844
- 2001:4860:4860::8888
search: []
set-name: eth0
To locate your Droplet’s IPv6 address and gateway address in the control panel, click Droplets, then click the Droplet’s name from the list. From the Droplet’s page, click Networking in the side menu. The Public Network section lists your Droplet’s IPv6 information.
Once you’ve edited and saved the file, run the following command to check the configuration’s syntax and temporarily apply the network changes:
sudo netplan apply --debug
If you receive the error Cannot call Open vSwitch: ovsdb-server.service is not running.
, you need to install the openvswitch-switch-dpdk
package on the Droplet. Open vSwitch is a virtual switch licensed under the open source Apache 2.0 license. It helps more efficiently forward packets via the kernel space data path. Run sudo apt-get install openvswitch-switch-dpdk
to install the package and then run netplan apply
again.
On Ubuntu 14.04 and Debian 10/11, open the /etc/network/interfaces
configuration file in a text editor.
Add the entire stanza below, substituting the substitute_your_primary_ipv6_address
variable with your Droplet’s IPv6 address, and the substitue_your_ipv6_gateway
variable with your Droplet’s gateway address:
iface eth0 inet6 static
hwaddress c6:45:b9:90:08:4b
address substitute_your_primary_ipv6_address/64
gateway substitue_your_ipv6_gateway
Once you’ve edited and saved the file, run the following command to check the configuration’s syntax and temporarily apply the network changes:
sudo systemctl restart networking
On FreeBSD, open the /etc/network/interfaces
configuration file in a text editor.
Add the entire stanza below, substituting the address
variable for your Droplet’s IPv6 address, and the gateway
variable for your Droplet’s gateway address:
iface eth0 inet6 static
address substitute_your_primary_ipv6_address
netmask 64
gateway substitute_your_ipv6_gateway
autoconf 0
dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 209.244.0.3
ssh
. However, when enabling IPv6 via ssh
, you cannot reset network or routing to verify your syntax without terminating your connection to the Droplet.On Fedora, use the Network Manager’s CLI to add the new IPv6 route to the Droplet’s network configuration.
To do this, first add the Droplet’s IPv6 address, followed by its /64
netmask value, to the eht0
interface:
nmcli connection modify "cloud-init eth0" ipv6.address <your-ipv6-address>/64
Then add the Droplet’s IPv6 gateway address to the configuration:
nmcli connection modify "cloud-init eth0" ipv6.gateway <your-gateway-address>
Lastly, add DigitalOcean’s DNS servers to the configuration:
nmcli connection modify "cloud-init eth0" ipv6.dns "2001:4860:4860::8844 2001:4860:4860::8888"
Once you have added all of the Droplet’s IPv6 information into the network configuration, restart the eth0
interface.
nmcli connection up "cloud-init eth0"
On CentOS 7/8/9, Rocky Linux 8/9, and Almalinux 8/9 open the /etc/sysconfig/network-scripts/ifcfg-eth0
configuration file in a text editor.
Add the following block, substituting the primary_ipv6_address
variable with your Droplet’s IPv6 address, and the ipv6_gateway
variable with your Droplet’s gateway address.
IPV6ADDR=primary_ipv6_address/64
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFAULTGW=ipv6_gateway
IPV6_FORCE_ACCEPT_RA=no
To locate your Droplet’s IPv6 address and gateway address in the control panel, click Droplets, then click the Droplet’s name from the list. From the Droplet’s page, click Networking in the menu on the left. The Public Network section lists your Droplet’s IPv6 information.
Once you’ve edited and saved the file, run the following command to check the configuration’s syntax and temporarily apply the network changes:
sudo systemctl restart NetworkManager.service
The verification prints any errors in the syntax on the screen. When the syntax is correct, the command returns you to the command prompt with no output.
Finally, reboot the server to apply the changes.
reboot
If you become locked out of your Droplet, you can access your Droplet from the Recovery Console to repair the file.
To use IPv6, both ends of the connection must be configured to send and receive IPv6 traffic. 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. For example, if your local machine does not have an IPv6 address, you cannot connect to your Droplet using its IPv6 address.
You can locate your public IPv6 address using test-ipv6.com.
To test the IPv6 configuration, try pinging the Google IPv6 name server from the Droplet:
ping6 2001:4860:4860::8888
If IPv6 is working correctly, you’ll receive output like this, which means the Droplet can communicate across the internet with other IPv6-enabled sites and servers.
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
Copy
To exit, press q.
If you receive the output ping: sendmsg: Network is unreachable
, verify 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.