IPv6 Configuration


Introduction

Internet Protocol version 6 (IPv6) is the latest version of the Internet Protocol (IP).

It is designed to address the long-anticipated address exhaustion of its predecessor, IPv4, by using 128-bits addresses instead of 32-bits addresses.

Every dedicated servers comes with a /64 IPv6 block. This represent 18,446,744,073,709,551,616 IPs addresses that you can use at your convenience.

In this guide, we will show you how to configure IPv6 addresses within our infrastructure.

Lexicon

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

Requirements

  • A dedicated server
  • IP failover(s) with associated vMAC
  • Knowledge about SSH
  • Basic knowledge in networking

Applying the configuration

Important

OVH DNS server is able to resolve IPv6 domain names ! You may refer to this guide to know how to add our DNS server in your configuration.

Every dedicated server comes with a /64 IPv6 block to use for your convenience.

If you are using an OVH-provided OS template to install your server, you will see that you already have the first (MAIN) IPv6 configured right out of the box.

If you want to use more than one IPv6 configured on your server (or want to use it on a VM) you will need to have a failover IP configured with a vMAC. Otherwise, the IPv6 won’t be routed by our routers/switches.

In our example below, we will show you how to configure an additionnal IPv6 on your server.

Note

The example shown below has been made in a debian-like environment.

Synopsis

  • We have been attributed the IPv6 block 2607:5300:60:47b3::/64
  • We want to configure 2607:5300:60:47b3::1 on a Virtual Machine
  • The gateway will be 2607:5300:60:47ff:ff:ff:ff:ff

Important

Since OVH uses a special type of routing, one might think the IPv6 gateway should be 2607:5300:60:47b3:ff:ff:ff:ff. But instead, the IPv6 gateway for your IPv6 block follow this template: xxxx:xxxx:xxxx:xxff:ff:ff:ff:ff. So, our IPv6 gateway in this example will be 2607:5300:60:47ff:ff:ff:ff:ff.

You must now edit your IP configuration file(s) using your prefered editor to add the following information. Here’s how it will look in a debian environment:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
auto eth0
iface eth0 inet static
    address xxx.xxx.xxx.xxx
    netmask 255.255.255.255
    broadcast xxx.xxx.xxx.254

    post-up route add xxx.xxx.xxx.254 dev eth0
    post-up route add default gw xxx.xxx.xxx.254
    pre-down route del xxx.xxx.xxx.xxx dev eth0
    pre-down route del default gw xxx.xxx.xxx.254

iface eth0 inet6 static
    address 2607:5300:60:47b3::1
    netmask 64

    post-up /sbin/ip -f inet6 route add 2607:5300:60:47ff:ff:ff:ff:ff dev eth0
    post-up /sbin/ip -f inet6 route add default gw 2607:5300:60:47ff:ff:ff:ff:ff
    pre-down /sbin/ip -f inet6 route del 2607:5300:60:47ff:ff:ff:ff:ff dev eth0
    pre-down /sbin/ip -f inet6 route del default gw 2607:5300:60:47ff:ff:ff:ff:ff

Warning

Pre-emptively, we strongly suggest our customers to disable IPv6 autoconf and router advertising to prevent known issues.

You can do so by adding the following lines to your sysctl.conf file:

net.ipv6.conf.eth0.autoconf=0
net.ipv6.conf.eth0.accept_ra=0

Once this has been done, you can apply those rules by executing the following command:

sysctl -p

Once this has been configured, restart the network interface (or restart the Virtual Machine):

service networking restart

Finally to test the IPv6 connectivity, simply ping another IPv6 address:

ping6 -c 4 2001:4860:4860::8888
 
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=55 time=23.6 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=55 time=23.8 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=55 time=23.9 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=55 time=23.8 ms
 
--- 2001:4860:4860::8888 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 23.670/23.670/23.670/0.000 ms

If you are not able to ping this IPv6 address, don’t hesitate to contact our support !

Application in different distributions

Debian & derivatives (Ubuntu, Crunchbang, SteamOS...)

File: /etc/network/interfaces

Assuming that your interface is eth0, the configuration should be like:

1
2
3
4
5
6
7
8
iface eth0 inet6 static
    address YOUR_IPV6
    netmask IPV6_PREFIX

    post-up /sbin/ip -f inet6 route add IPV6_GATEWAY dev eth0
    post-up /sbin/ip -f inet6 route add default via IPV6_GATEWAY
    pre-down /sbin/ip -f inet6 route del IPV6_GATEWAY dev eth0
    pre-down /sbin/ip -f inet6 route del default via IPV6_GATEWAY

Redhat & derivatives (CentOS, Scientific Linux, ClearOS...)

Warning

This example has been made with CentOS 7.0. Some result may differ in other redhat derivatives.

Assuming that your interface is eth0, the configuration should be like:

File: /etc/sysconfig/network-scripts/ifcfg-eth0

Important

In this example, I avoided the IPv4 Failover configuration to avoid confusion, but the IPv6 configuration is made in the same configuration file.

1
2
3
4
5
6
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR=YOUR_IPV6/IPV6_PREFIX ---> (basically your IPV6 in CIDR notation)
IPV6_DEFAULTGW=IPV6_GATEWAY

FreeBSD 10

File: /etc/rc.conf

Assuming that your interface is em0, the configuration should be like:

1
2
3
ipv6_activate_all_interfaces="YES"
ipv6_defaultrouter="IPV6_GATEWAY"
ifconfig_em0_ipv6="inet6 YOUR_IPV6 prefixlen 64"

Important

if you are using FreeBSD 8.3 or earlier version, the configure should look like:

1
2
3
ipv6_enable="YES"
ipv6_defaultrouter="IPV6_GATEWAY"
ipv6_ifconfig_em0="YOUR_IPV6 prefixlen 64"

Windows 2008/2012/Hyper-V

Note

Work in progress..