Skip to content

Instantly share code, notes, and snippets.

@casualjim
Last active January 21, 2023 20:03
Show Gist options
  • Save casualjim/88cda9b5a9cd0a948122592e14b9ad8d to your computer and use it in GitHub Desktop.
Save casualjim/88cda9b5a9cd0a948122592e14b9ad8d to your computer and use it in GitHub Desktop.
Actually working IPv6 dedicated server configuration for ubuntu

Configure IPv6 on Ubuntu 20.04 on OVH dedicated

Contrary to the guide, do this instead

the gateway is in the /56 network but so you have to get your ip in there.

Edit: /etc/netplan/50-cloud-init.yaml

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eno1:
            dhcp4: true
            match:
                macaddress: xx:xx:xx:xx:xx:xx
            set-name: eno1
            addresses: ["${YOUR_IPV6_ADDRESS}/56"]
            routes:
            - to: "${IPV6_GATEWAY}"
              scope: link
            - to: default
              via: "${IPV6_GATEWAY}"
              on-link: true

This sets up some persistent config, it also renames the interface which happens a bit too late for systemd-networkd

Next also configure your interface, in my case in /etc/systemd/network/pub.network

[Match]
MACAddress=xx:xx:xx:xx:xx:xx

[Network]
DHCP=ipv4
IPv6AcceptRA=no
LinkLocalAddressing=no

[Address]
Address=${YOUR_IPV6_ADDRESS}/56

[Route]
Gateway=${IPV6_GATEWAY}
GatewayOnLink=yes

And then reboot

sudo systemctl reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment