Configuring IPv6 After Changing the IPv6 of Your Virtual Machine

When you change the IPv6 address of your Hetzner virtual machines in Doprax, there’s an extra step needed to fully configure it.

If you’re using Ubuntu 20.04 or later with Netplan, follow these steps to complete the process:

Last updated: January 31, 2025

Access Your VM via SSH

The easiest way to access your VM is to use the Doprax in-browser terminal. It is a one-click process. You can use SSH clients like Linux or Mac’s terminal or in Windows, Putty, or any other SSH client of your choice to connect to your server.

Edit the Network Configuration File

Open the Netplan configuration file using your preferred text editor:

nano /etc/netplan/50-cloud-init.yaml
  • Find the addresses section under the relevant Ethernet interface (e.g., eth0).
  • Add your new primary IPv6 address from your Doprax subnet. Replace 2001:db8:0:3df1::1 with your desired IPv6 address.
  • Example:
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - <IPv6 address from your subnet, e.g., 2001:db8:0:3df1::1>/64
      dhcp4: true
      routes:
        - to: default
          via: fe80::1
      match:
        macaddress: your-original-macaddress
      nameservers:
        addresses:
          - 2a01:4ff:ff00::add:2
          - 2a01:4ff:ff00::add:1
      set-name: eth0

Note: Make sure you don’t change any other settings like the MAC address.

Apply the Changes

To save and exit in Nano, press Ctrl + O to write the changes, then hit Enter to confirm. Afterward, press Ctrl + X to exit the editor.

Run the following command to apply your updated configuration:

sudo netplan apply

Your new primary IPv6 address should now be active on your server.