Configure an IPv6 on a OneProvider Dedicated Server (Ubuntu)

By default, dedicated servers provided by OneProvider (Online/Scaleway infrastructure) do not automatically configure IPv6.
You need to manually set up your fixed IPv6 address.

After some research, I adapted the method found on lafibre.info for Ubuntu.

👉 Source: lafibre.info – How to enable IPv6 on your dedicated server


Step 1: Create a systemd service for dhclient6

Create the file /etc/systemd/system/dhclient6.service:

INI
[Unit]
Description=ISC DHCP client to send DUID for IPv6 and add IPv6 to interface
After=network.target
Wants=network.target network-online.target
Before=network-online.target
ConditionPathExists=/etc/dhcp/dhclient6.conf
ConditionPathExists=/etc/dhcp/dhclient6.vars

[Service]
EnvironmentFile=/etc/dhcp/dhclient6.vars
Type=forking
Restart=always
RestartSec=2s
TimeoutSec=10s
ExecStart=/sbin/dhclient -1 -v -pf /run/dhclient6.pid -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhcp/dhclient6.leases -6 -P ${DH6IF}
ExecStartPost=/sbin/ip -6 addr add ${DH6IP}/${DH6PF} dev ${DH6IF}
ExecStop=/sbin/ip -6 addr del ${DH6IP}/${DH6PF} dev ${DH6IF}
ExecStop=/sbin/dhclient -r -v -pf /run/dhclient6.pid -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhcp/dhclient6.leases -6 ${DH6IF}
PIDFile=/run/dhclient6.pid

[Install]
WantedBy=multi-user.target network-online.target
Click to expand and view more

Step 2: Configure the DHCPv6 client

Create the file /etc/dhcp/dhclient6.conf by adapting the interface name (enXXX) and the DUID provided by OneProvider:

CONF
interface "enXXX" {
  send dhcp6.client-id 00:03:00:01:XX:XX:XX:XX:XX:XX;
}
Click to expand and view more

Step 3: Define network variables

Create /etc/dhcp/dhclient6.vars with your IPv6, prefix, and interface:

BASH
# For dhclient6.service, provide IPv6 IP, desired prefix, and interface
DH6IP=2001:bc8:XXXX:XXXX::1
DH6PF=64
DH6IF=enXXX
Click to expand and view more

Step 4: Enable the service

Reload systemd and enable the service:

BASH
sudo systemctl daemon-reload
sudo systemctl enable dhclient6.service
Click to expand and view more

Step 5: Adjust sysctl

Create /etc/sysctl.d/01-ipv6-networking.conf to control routing:

CONF
# set routing
net.ipv6.conf.all.forwarding=0 # 1 if routing is needed
# ipv6: disable slaac but allow default route
net.ipv6.conf.enXXX.autoconf=0
net.ipv6.conf.enXXX.accept_ra=1 # 2 if forwarding=1
Click to expand and view more

Notes:


Step 6: Apply the configuration

To activate immediately:

BASH
sudo sysctl --system
sudo systemctl start dhclient6
Click to expand and view more

Or after a reboot:

BASH
sudo reboot
Click to expand and view more

⚠️ Warning: Don’t forget to open UDP port 546 (DHCPv6 client) in your firewall so that the dhclient6 service works properly.

Conclusion

With this configuration, your Ubuntu OneProvider server has a dedicated and persistent IPv6 address.
The systemd + dhclient6 approach is simple, reliable, and works even after a server restart.

Copyright Notice

Author: PikaTech

Link: https://pikatech.org/en/posts/configure-ipv6-oneprovider-ubuntu/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut