How to configure IPv6 Print

  • ipv6, networking, netplan, aaaa record
  • 0

IPv6 is the successor to IPv4, using 128-bit addresses instead of 32-bit ones. It exists because the pool of IPv4 addresses is effectively exhausted while the number of devices online keeps growing.

To get an IPv6 address for your server, see How do I get IPv6 addresses for my server? — one address is assigned per server, on request. This article covers configuring it once it has been assigned.

You will need three values from us: the address, the prefix length (normally 64) and the gateway. The examples below use the address 2a01:240:253:81e4::2 and the gateway 2a01:240:253:81e4::1 — replace them with your own; they are not the same for every server.

Have console access ready before you start. A mistake in the network configuration can cut off SSH: see Managing your CloudVM virtual server in the client area for virtual servers or What is IPMI (IP-KVM) and how do I connect to it? for dedicated ones.

Which section applies to your server

Operating system Configured with
Ubuntu 24.04 LTS, 22.04 LTSnetplan
Debian 13, 12, 11ifupdown (/etc/network/interfaces)
AlmaLinux 9+, Rocky Linux 9+, RHEL 9+NetworkManager (nmcli)
Windows Servernetwork adapter properties

Check the real name of your interface first with ip link show — it may be eth0, ens3, enp1s0 or something else — and use that name, not the one from the examples.

Ubuntu 24.04 / 22.04 (netplan)

Add the IPv6 address to the file in /etc/netplan/:

network:
  version: 2
  ethernets:
    ens3:
      addresses:
        - 1.2.3.4/24
        - "2a01:240:253:81e4::2/64"
      routes:
        - to: default
          via: 1.2.3.1
        - to: "::/0"
          via: "2a01:240:253:81e4::1"

Test before applying permanently:

netplan try

This reverts automatically if you do not confirm within a couple of minutes — which is what you want if the change breaks your own connection. Then:

netplan apply

YAML is indentation-sensitive, and IPv6 addresses should be quoted.

Debian 13 / 12 / 11 (ifupdown)

Add to /etc/network/interfaces:

iface eth0 inet6 static
    address 2a01:240:253:81e4::2
    netmask 64
    gateway 2a01:240:253:81e4::1

Then restart networking:

systemctl restart networking

AlmaLinux / Rocky Linux / RHEL 9+ (NetworkManager)

nmcli connection show
nmcli connection modify "System eth0" +ipv6.addresses 2a01:240:253:81e4::2/64
nmcli connection modify "System eth0" ipv6.gateway 2a01:240:253:81e4::1
nmcli connection modify "System eth0" ipv6.method manual
nmcli connection up "System eth0"

The first command lists the connections so that you can use the exact name in the others.

Windows Server

Open Control Panel → Network and Sharing Center → Change adapter settings, right-click the adapter and choose Properties, then select Internet Protocol Version 6 (TCP/IPv6) and enter the address, prefix length and gateway.

Check the result

Confirm the address is present on the interface:

ip -6 addr

Then test connectivity outwards:

ping6 ipv6.google.com

On Windows, use ping -6 ipv6.google.com from PowerShell.

Finally reboot the server and check again — a configuration that works until the next reboot is a common result of editing the wrong file.

Once IPv6 works

For visitors to reach your sites over IPv6, add an AAAA record for each domain pointing to the new address. Without it, nothing changes for anyone: the server is reachable over IPv6, but no one is told to try.

Check your firewall as well. Rules written for IPv4 do not apply to IPv6, and a server that was carefully firewalled on IPv4 can end up with services fully exposed over IPv6. On Linux this means ip6tables, or the IPv6 side of nftables or your firewall front-end.

If IPv6 does not work after configuration, open a ticket from your client area with the address you were assigned and the output of ip -6 addr.


Was this answer helpful?

« Back