Configuring IPv6 on a Public Cloud instance

Objective

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.

This guide will show you how to configure an IPv6 address on a Public Cloud instance.

Info

Floating IP and Gateway currently do not support IPv6. You can only use IPv6 with instances in Public Mode.

Requirements

  • A Public Cloud instance (any model)
  • Administrative access (sudo) via SSH or remote desktop (Windows) to your server
  • A basic understanding of networking

OVHcloud Control Panel Access


Instructions

The following sections contain configurations for the distributions we currently offer, as well as the most commonly used distributions/operating systems. The first step is always to log in to your server via SSH or a GUI login session (RDP for a Windows instance).

Warning

Please note that the IPv6 address is configured by default on our Public Cloud instances. Be sure to check the operating system configuration file before making any changes.

Glossary

Here is a short glossary of the terms used in this tutorial:

GlossaryDescription
YOUR_IPV6The IPv6 address assigned to your service. (e.g. 2607:5300:60:62ac:abcd)
IPV6_PREFIXThe prefix of your IPv6 block (e.g. 2607:5300:60:62ac::/128 -> netmask = 128)
IPV6_GATEWAYThe gateway of your IPv6 block.(e.g. 2607:5300:60:62ac::1)

Retrieve your network information

In your Public Cloud project, click on Instances in the left-hand menu.

Click on ... next to the corresponding instance and click on Instance details.

public-cloud ipv6

All the information you need is in the Networks section.

public-cloud ipv6

Examples of persistent configuration

Info

Examples

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.

Warning

Before modifying a configuration file always create a backup of the original.


First of all, connect to your instance via SSH.

Tip

Select the tab corresponding to your operating system.

Debian (excluding Debian 12)
Ubuntu and Debian 12
RedHat / CloudLinux / Rocky Linux (8 & 9) / AlmaLinux (8 & 9)
Fedora / Rocky Linux (10) / AlmaLinux (10)
Windows

By default, the configuration files are located in /etc/network/interfaces.d/.

The best practice is to create a separate configuration file in the /etc/network/interfaces.d/ directory to configure IPV6. In our example, our file is called 51-cloud-init-ipv6:

sudo nano /etc/network/interfaces.d/51-cloud-init-ipv6

This separates the IPv6 configuration and lets you revert changes easily if needed.

Add the following lines to the file. Replace the generic elements (i.e. YOUR_IPV6, IPV6_PREFIX and IPV6_GATEWAY) as well as the network interface (if your server is not using eth0) with your specific values:

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
Configuration example
iface eth0 inet6 static
address 2607:5300:201:abcd::7c5
netmask 128
post-up /sbin/ip -6 route add 2607:5300:201:abcd::1 dev eth0
post-up /sbin/ip -6 route add default via 2607:5300:201:abcd::1 dev eth0
pre-down /sbin/ip -6 route del default via 2607:5300:201:abcd::1 dev eth0
pre-down /sbin/ip -6 route del 2607:5300:201:abcd::1 dev eth0

Then restart your network service with one of the following commands:

sudo service networking restart
sudo systemctl restart networking

Diagnostic

Have you configured your IPv6, but found that nothing works?

To determine whether the error is in your configuration or on the OVHcloud network, run this simple test.

First, put your instance into rescue-pro mode.

Next, use the template commands below to configure your IPv6 non-persistently, replacing YOUR_IPV6, IPV6_PREFIX and IPV6_GATEWAY 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

If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts to assist you with your use case.

Join our community of users.

Was this page helpful?