Introduction

Internet Protocol version 6 (IPv6) is the latest version of the Internet Protocol (IP).
It was designed to solve the long anticipated exhaustion of IPv4 addresses by using addresses consisting of 128 bytes instead of the traditional 32-byte IPv4.
This guides explains how to configure IPv6 addresses in our infrastructures.

Prerequisites:
  • An OVH VPS server
  • Knowledge of SSH
  • Basic network understanding
.

Glossary

Element Description
IPV6_BLOCK IPv6 block assigned to your service
YOUR_IPV6 Your IPv6 that you want to configure
IPv6_PREFIX The prefix of your IPv6 block (Ex: 2607:5300:60:62ac::/64 -> netmask = 64)

Get the necessary network information

.

Via your Customer Account

Log in to your OVH Customer Account, then select your VPS.
Your IPv6 will be on the main page, as shown in the image.
Please note, the IPv6 Gateway address is not currently available in your customer account, you need to use the OVH API to continue
.

Via the OVH API

You can write a script or use our console on
https://api.ovh.com/
Once you are logged on with your personal details, see the necessary API calls:
Get your IPv6
https://api.ovh.com/console/#/vps/{serviceName}/ips#GET
{
"92.222.xx.xx"
"2001:41d0:401:3100:0000:0000:0000:0002"
}
Get your Gateway
https://api.ovh.com/console/#/vps/{serviceName}/ips/{ipAddress}#GET
{
macAddress: ""
version: "v6"
gateway: "2001:41d0:401:3100:0000:0000:0000:0001"
ipAddress: "2001:41d0:401:3100:0000:0000:0000:0002"
type: "primary"
geolocation: "fr"
reverse: ""
}

Apply IPv6 to different distributions

.

Non-persistent application

You will lose this configuration after restarting your VPS
(non-persistent configuration)
Considering that your interface is eth0, the configuration should look something like this:
ip addr add 2001:41d0:401:3100:0000:0000:0000:0002/128 dev eth0
ip -6 route add 2001:41d0:401:3100:0000:0000:0000:0001 dev eth0
ip -6 route add default via 2001:41d0:401:3100:0000:0000:0000:0001 dev eth0
.

Persistent application on Debian and derrivatives (Ubuntu, Crunchbang, SteamOS...)

File to modify (with sudo privileges)
/etc/network/interfaces
Considering that your interface is eth0, the configuration to add should look something like this:
iface eth0 inet6 static
address 2001:41d0:401:3100::2
netmask 128
post-up /sbin/ip -6 route add 2001:41d0:401:3100::1 dev eth0
post-up /sbin/ip -6 route add default via 2001:41d0:401:3100::1 dev eth0
pre-down /sbin/ip -6 route del default via 2001:41d0:401:3100::1 dev eth0
pre-down /sbin/ip -6 route del 2001:41d0:401:3100::1 dev eth0
.

Persistent application on Redhat and derivatives (CentOS, ClearOS...)

Considering that your interface is eth0, the configuration should look something like this:

File to modify (with sudo privileges)
/etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6ADDR=2001:41d0:401:3100::2/128
IPV6_DEFAULTGW=2001:41d0:401:3100::1

File to create (with sudo privileges): /etc/sysconfig/network-scripts/route6-eth0
2001:41d0:401:3100::1 dev eth0
default via 2001:41d0:401:3100::1

Test the connection

To check the configuration, on eth0 for example:
ip -6 addr show eth0

This command should return at least one configured IPv6 address
There are several ways to test the connection.
We first have to understand that IPv6 has to be enabled on both sides of the connection for IPv6 communication to work.
With this in mind, one possible test is to ping an IPv6 from your VPS:
ping6 ipv6.google.com