Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

How to configure IPv6 connectivity using systemd-networkd

Before you start

To complete the actions presented below, you must have:

Note

If you are running Ubuntu and using Netplan, follow the Ubuntu (Netplan) section. If you use systemd-networkd directly, or run a different Linux distribution, follow the Linux (systemd-networkd) section. If you use dhcpcd or your Linux distribution uses ifupdown, follow the **Linux (dhcpcd) section.

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.

  1. Open the default configuration file /etc/netplan/01-netcfg.yaml in 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 enp1s0 with the proper name of your internet interface.

    Note

    The configuration example above is valid for the main IP address of your Dedibox server. If you want to use IPv6 on a virtual machine, remember to use the unique gateway for the failover IPv4.

  2. Apply and verify the configuration:

    sudo netplan --debug apply
  3. 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.

Tip

When specifying the IP address of your Dedibox, you need to enter it in CIDR notation. The netmask for the main IPv4 of a Dedibox server is /24, the netmask for a failover IPv4 is /32. The netmask for the IPv6 is /64.

  1. Run the ip link show command 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.

  2. Create a networkd config file:

    touch /etc/systemd/network/eno1.network
  3. 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
    Note

    To retrieve the DUID run the follwoing command:

    journalctl -u systemd-networkd | grep -i duid
  4. 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).

  1. Enable SLAAC on your dashboard, if your server supports it.

    Tip

    If SLAAC is not provided for your Dedibox, you can skip to the dhcpcd configuration.

  2. 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_ra

    Next, configure dhcpcd:

  3. Copy DUID into /var/lib/dhcpcd/duid. This file is auto-generated the first time by dhcpcd.

    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.

  4. Update the configuration of /etc/dhcpcd.conf with 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 -.

  5. Restart the appropriate service:

    On Debian, you can restart networking which relies on ifup:

    sudo systemctl restart networking

    Or 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

TypeCIDR
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.

Still need help?

Create a support ticket
No Results