Learn how to configure an IPv6 address on a Public Cloud instance.
Internet Protocol version 6 (IPv6) is the latest version of Internet Protocol (IP). It is designed to resolve the long-anticipated exhaustion of IPv4 addresses, by using addresses made up of 128-bits rather than the standard 32-bits of IPv4.
Each Public Cloud instance is delivered with an IPv4 address and an IPv6 address.
By default, only the IPv4 address is configured.
Requirements
- A Public Cloud instance (any model)
- Administrative access (root) via SSH or remote desktop (Windows) to your server
- A basic understanding of networking
- Access to the OVHcloud Control Panel
Instructions
Glossary
Here is a short glossary of the terms used in this tutorial:
Glossary | Description |
YOUR_IPV6 | The IPv6 address assigned to your service. |
IPV6_PREFIX | The prefix of your IPv6 block (e.g. 2607:5300:60:62ac::/128 -> netmask = 128) |
IPV6_GATEWAY | The gateway of your IPv6 block. |
Retrieve your network information
From the OVHcloud Control Panel:
- Open your
Public Cloud
project. - Click on
Instances
in the left-hand menu. - Click on the more options
...
button next to the corresponding instance. - Click on
Instance details
.
All the information you need is in the Networks section.
Examples of persistent configuration
- The information below is provided as an example.
- Since you are the admin of your services, you will need to adapt the information to match your distribution or operating system.
First of all, connect to your instance via SSH.
On Debian
If we assume that your interface is eth0, the configuration should look like this:
File to edit (with su privileges): /etc/network/interfaces
iface eth0 inet6 static
address YOUR_IPV6
netmask IPV6_PREFIX
post-up /sbin/ip -6 route add IPV6_GATEWAY dev eth0
post-up /sbin/ip -6 route add default via IPV6_GATEWAY dev eth0
pre-down /sbin/ip -6 route del default via IPV6_GATEWAY dev eth0
pre-down /sbin/ip -6 route del IPV6_GATEWAY dev eth0
Here is a concrete example:
iface eth0 inet6 static
address 2001:41d0:xxx:xxxx::999
netmask 128
post-up /sbin/ip -6 route add 2001:41d0:xxx:xxxx::111 dev eth0
post-up /sbin/ip -6 route add default via 2001:41d0:xxx:xxxx::111 dev eth0
pre-down /sbin/ip -6 route del default via 2001:41d0:xxx:xxxx::111 dev eth0
pre-down /sbin/ip -6 route del 2001:41d0:xxx:xxxx::111 dev eth0
On Ubuntu
The network configuration files are located in the /etc/netplan/
directory. First, create a copy of the IPv6 configuration file:
cd /etc/netplan
cp 50-cloud-init.yaml 51-cloud-init-ipv6.yaml
This allows you to separate the IPv6 configuration and easily revert the changes in case of an error.
If we assume that your interface is eth0, the configuration should look like this:
File to edit (with su privileges): /etc/netplan/51-cloud-init-ipv6.yaml
network:
ethernets:
eth0:
dhcp6: false
match:
macaddress: fb:17:3r:39:56:75
set-name: eth0
addresses:
- "YOUR_IPV6/IPv6_PREFIX"
gateway6: "IPv6_GATEWAY"
routes:
- to: "IPv6_GATEWAY"
scope: link
version: 2
You can test your configuration using this command:
netplan try
If it is correct, apply it using the following command:
netplan apply
On RedHat / CentOS
If we assume that your interface is eth0, the configuration should look like this:
File to edit (with sudo privileges): /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6ADDR=YOUR_IPV6/IPV6_PREFIX
IPV6_DEFAULTGW=IPV6_GATEWAY
Here is a concrete example:
IPV6INIT=yes
IPV6ADDR=2001:41d0:xxx:xxxx::999
IPV6_DEFAULTGW=2001:41d0:xxx:xxxx::111
On Windows
Go to Network Connections
in Windows.
Then go to Properties
for your network card by right-clicking on it.
Next, click on IPv6
, and Properties
.
Lastly, enter your IPv6 details.
Diagnostic
Have you configured your IPv6, but found that nothing works?
There is a simple operation to determine whether the error is in your configuration, or on the OVHcloud network.
Firstly, put your instance into rescue-pro mode.
Next, use the template commands below to configure your IP non-persistently, replacing ‘YOUR_IPV6’, ‘IPV6_PREFIX’, etc. with your own details:
ip addr add YOUR_IPV6/IPV6_PREFIX dev eth0
ip -6 route add IPV6_GATEWAY dev eth0
ip -6 route add default via IPV6_GATEWAY dev eth0
Test your network again via a ping6, for example:
ping6 ipv6.google.com
If your instance responds, it is likely that there is an error in one of the steps taken for your initial configuration.
In any case, please feel free to reach out to our support team with the elements tested above, and we can perform an analysis on our end.
Go further
For more information and tutorials, please see our other Public Cloud Networking support guides or explore the guides for other OVHcloud products and services.