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
:
[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
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:
interface "enXXX" {
send dhcp6.client-id 00:03:00:01:XX:XX:XX:XX:XX:XX;
}
Step 3: Define network variables
Create /etc/dhcp/dhclient6.vars
with your IPv6, prefix, and interface:
# For dhclient6.service, provide IPv6 IP, desired prefix, and interface
DH6IP=2001:bc8:XXXX:XXXX::1
DH6PF=64
DH6IF=enXXX
Step 4: Enable the service
Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable dhclient6.service
Step 5: Adjust sysctl
Create /etc/sysctl.d/01-ipv6-networking.conf
to control routing:
# 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
Notes:
- If you are not routing → leave
forwarding=0
andaccept_ra=1
. - If you want to propagate IPv6 (VMs, containers, tunnels) → set
forwarding=1
andaccept_ra=2
.
Step 6: Apply the configuration
To activate immediately:
sudo sysctl --system
sudo systemctl start dhclient6
Or after a reboot:
sudo reboot
⚠️ 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.