How to configure your routed /48 IPv6 prefix on Linux

This article shows you how to setup your /48 routed IPv6 subnet on Debian, CentOS, FreeBSD and Windows.

All our servers are delivered with a single IPv4, a single IPv6 and a routed /48 subnet which is automatically routed to your single IPv6 address.

The IPv6 address is linked to your IPv4 address. This means that if your IP is for example 185.181.60.123, your IPv6 address would be 2a03:94e0:ffff:185:181:60::123. The IPv6 address is in a /118 prefix, where 2a03:94e0:ffff:185:181:60::1 is your gateway address.

When installing your server, we automatically configure your single IPv6 address.

Subnet in this example: 2a03:94e0:123::/48

Debian / Ubuntu

Open /etc/network/interfaces. Your IPv6 configuration will already be present in the file, which may look similar to this:

iface eth0:0 inet6 static
address 2a03:94e0:ffff:185:181:60::123
netmask 118
gateway 2a03:94e0:ffff:185:181:60::1

Add the following block for each address you want to add (replace X with a incremental number):

iface eth0:**X** inet6 static
address 2a03:94e0:123::1
netmask 48

Please note that your interface may differ from the example above. Instead of eth0 it can be e.g. ens0, or ens12930.

Save the file and restart your network by issuing service networking restart. We usually recommend a full reboot of your serviceer.

CentOS / RHEL

Open /etc/sysconfig/network-scripts/ifcfg-eth0 and this line:

IPV6ADDR_SECONDARIES="2a03:94e0:123::1/48"

Replace eth0 with your respective interface name. It may not be the same.

Save the file and restart your network by issuing service network restart. We usually recommend a full reboot of your server.

FreeBSD

Open /etc/rc.conf and add this line:

ifconfig_em0_ipv6="inet6 2a03:94e0:123::1 prefixlen 48"

Replace em0 with your respective interface name. It may not be the same.

Last updated on 22nd Sep 2021