How to configure IPv6 connectivity using systemd-networkd
Before you start
To complete the actions presented below, you must have:
- A Dedibox account logged into the console
- A Dedibox dedicated server
- Requested a /48 IPv6 prefix
How to configure IPv6 on Ubuntu
Ubuntu uses netplan since the release of Ubuntu 18.04 LTS as network configuration tool. It replaces the classical network configuration with new configuration files, written in YAML format, and located in the /etc/netplan directory. For more information regarding netplan, refer to the official documentation.
-
Open the default configuration file
/etc/netplan/01-netcfg.yamlin a text editor, and edit it as follows:network: version: 2 renderer: networkd ethernets: enp1s0: dhcp4: false dhcp6: false addresses: - "AAA.BBB.CCC.DDD/24" # Dedibox IPv4 - "2001:bc8:xxxx:xxx::1/64" # Assigned IPv6 gateway4: "AAA.BBB.CCC.1" routes: - to: 0.0.0.0/0 via: "AAA.BBB.CCC.1" on-link: true nameservers: addresses: - "51.159.47.28" # Replace with the DNS server closest to your DC - "51.159.47.26"Remember to replace
enp1s0with the proper name of your internet interface. -
Apply and verify the configuration:
sudo netplan --debug apply -
Verify addressing:
ip -4 addr ip -6 addr ip -6 route
How to configure IPv6 on Linux with systemd-networkd
systemd-networkd is the network manager of systemd. Most modern Linux distributions ship with systemd-networkd. This method is appropriate when you:
- run distributions that do not use Netplan
- prefer low-level network configuration
- configure containers or VMs manually
Your IPv6 prefix is routed statically; DHCPv6 is used only for lease negotiation and DUID identification — not for address assignment.
-
Run the
ip link showcommand to find the name of your public internet interface (Example:eno1). Make sure to store it, as it will be required in the next steps. -
Create a networkd config file:
touch /etc/systemd/network/eno1.network -
Open the file in a text editor and paste the following content. Make sure to replace the values in the example with your own and save them before exiting the text editor.
[Match] Name=eno1 [Network] # Static IPv4 and IPv6 assignment Address=AAA.BBB.CCC.DDD/24 Address=2001:bc8:xxxx:xxx::1/64 Gateway=AAA.BBB.CCC.1 DNS=51.159.47.28 DNS=51.159.47.26 # DHCPv6 only for PD negotiation DHCP=ipv6 IPv6AcceptRA=yes [DHCP] ClientIdentifier=duid DUIDType=link-layer # The Scaleway DUID (without DUID-LL prefix "00:03") DUIDRawData=<Scaleway-IPv6-DUID> [IPv6AcceptRA] # Required to properly accept Prefix Delegation DHCPv6Client=always UseOnLinkPrefix=false UseAutonomousPrefix=false -
Run the following command to activate the new configuration.
sudo systemctl enable --now systemd-networkd
How to configure IPv6 on Linux with dhcpcd
This section expands the existing tutorial on dhcpcd.
On certain Linux distributions like Debian Trixie, you may find dhcpcd alongside ifup (dhcpcd-base must be installed).
-
Enable SLAAC on your dashboard, if your server supports it.
-
Ensure the interface and firewall allow IPv6 routing advertisements.
For instance, if your interface is named
eno1, as root, you can set it using:echo 1 > /proc/sys/net/ipv6/conf/eno1/accept_raNext, configure
dhcpcd: -
Copy DUID into
/var/lib/dhcpcd/duid. This file is auto-generated the first time bydhcpcd.While there is a
duid <uuid>option in the configuration, the Scaleway one is not in the correct format, resulting in the client using the generated one. -
Update the configuration of
/etc/dhcpcd.confwith the following:interface eno1 # request to use dhcpv6 dhcp6 # request a non-temporary address ia_na # sets the "identifier" of the interface to 1 iaid 1 # request a prefix delegation on the interface 1 but do not allocate it (-) ia_pd 1 -If you are only using the /48, you should request a prefix delegation (
ia_pd) and allocate it to other interfaces (VMs, VPN, etc.) or just keep it blank with-. -
Restart the appropriate service:
On Debian, you can restart
networkingwhich relies onifup:sudo systemctl restart networkingOr if you use a distribution that has standalone
dhcpcd:sudo systemctl restart dhcpcd@eno1
Additional notes
IPv6 addressing
- Your /48 prefix must be subdivided into /64 networks
- The host config generally uses one /64 per interface
CIDR quick reference
| Type | CIDR |
|---|---|
| Main IPv4 | /24 |
| Failover IPv4 | /32 |
| Single IPv6 subnet | /64 |
| Delegated IPv6 prefix | /48 |
DNS servers
Scaleway resolvers vary by datacenter. Refer to Scaleway network information for more information.