Configure IPv6 block on a dedicated server using networkd

Not all dedicated servers include an IPv6 addresses block by default. In order to have an IPv6 addresses block, you will have to include it when placing an order. This option could be spotted on the order form before submission:


In case you already have an IPv6 block assigned to your dedicated server it will be visible under service management "My Services" >> Select your server from the list >> Select tab "Manage server". There you will assign block assigned to current server along with DUID:


In order to enable the IPv6 addresses block for your server the following steps are required:


1. As a first step, it is indicated to create a backup of current networkd configuraiton by using the following command:

sudo mv /etc/network/interfaces /etc/network/interfaces.backup 


2. Make sure networkd is enabled. Don't try to start it yet as connection with your server my break:

systemctl enable systemd-networkd


3. Create the following config file

sudo touch /etc/systemd/network/ip6cfg.netdev

and then append the following content:

[NetDev]
Name=ip6cfg
Kind=dummy


4. Create a new network configuration file as follows

sudo touch /etc/systemd/network/your_network_name.network

where your_network_name is current network interface name. You could use $ ip link show to get the name (it should be eth0 or enp1s0f0)


5. In the end, add the following configuration to your newly configured network configuration file:

[Match]
# The name must correspond to your interface name
Name=enp1s0
 
[Network]
DHCP=ipv6
IPv6AcceptRA=True
# IPv4 of the Dedibox
Address=<main_ip4_of_your_dedicated_server>/<netmask>
# IPv6 of the Dedibox
Address=<ipv6_of_your_dedicated_server>/<netmask>

[Route]
# The gateway is either your server ip ending on .1 (i.e. x.y.z.1) for the physical host or 62.210.0.1 for any VM running on the dedicated server
Gateway=<gateway_ip>
GatewayOnlink=yes

[DHCP]
ClientIdentifier=duid-only
DUIDType=link-layer
# DUID without 00:03 at the begginnig
DUIDRawData=<full DUID>
ForceDHCPv6PDOtherInformation=yes

[IPv6AcceptRA]
UseOnLinkPrefix=False
UseAutonomousPrefix=False


All the info from the configuration shall be available under control panel at "My Services" >> Select your server from the list >> Select tab "Manage server".


6. A reboot is required in order for changes to be enabled:

sudo reboot