View Categories

How to add IPv6 addresses to a dedicated server

2 min read

When a dedicated server is ordered with IPv6, the server requires manual configuration to enable and connect via IPv6.

All IPv6 subnets are routed through a main /126 address with gateway, and allows individual addresses from the subnet to be assigned.

 

Below are configuration examples for the most common operating systems…

Example Setup #

When a server is delivered, the handover ticket will include the following details:

IPv6:
Main: 2a0a:8dc0:2000:108::2/126
Gateway: 2a0a:8dc0:2000:108::1
Subnet: 2a0a:8dc0:2108::/48

 

In the below configuration examples for the most common operating systems, we’ll add two addresses from the /48 subnet:

  • 2a0a:8dc0:2108::a
  • 2a0a:8dc0:2108::b

We’ll also add Google IPv6 DNS servers to the configuration:

  • 2001:4860:4860::8888
  • 2001:4860:4860::8844

 

Ubuntu 22.04 / 24.04 (Netplan) #

Orignal Configuration of /etc/netplan/00-installer-config.yaml

network:
  ethernets:
    all_interfaces:
      addresses:
      – 172.16.1.100/25
      gateway4: 172.16.1.1
      match:
        macaddress: 4F:43:D6:F9:7D:67
      nameservers:
        addresses:
        – 8.8.8.8
        – 1.1.1.1
  version: 2

 

Updated configuration with IPv6:

network:
  ethernets:
    all_interfaces:
      addresses:
      – 172.16.1.100/25
      – 2a0a:8dc0:2000:108::2/126
      – 2a0a:8dc0:2108::a/48
      – 2a0a:8dc0:2108::b/48
      gateway4: 172.16.1.1
      gateway6: 2a0a:8dc0:2000:108::1
      match:
        macaddress: 4F:43:D6:F9:7D:67
      nameservers:
        addresses:
        – 8.8.8.8
        – 1.1.1.1
        – 2001:4860:4860::8888
        – 2001:4860:4860::8844
  version: 2

 

Use the netplan try command to temporarily apply the config to the system:

netplan try

If connection to the server is still established, press enter to commit to the new config, otherwise after 120 seconds configuration will revert back to the previous state.

 

Debian 11 / Debian 12 #

Original configuration of /etc/network/interfaces

allow-hotplug enp1s0f0
  iface enp1s0f0 inet static
  address 172.16.1.100/25
  gateway 172.16.1.1
  # dns-* options are implemented by the resolvconf package, if installed
  dns {‘nameservers’: [‘8.8.8.8’, ‘8.8.4.4’], ‘search’: []}
  dns-search unassigned-domain

Add the following to the interfaces file:

allow-hotplug enp1s0f0
  iface enp1s0f0 inet static
  address 172.16.1.100/25
  gateway 172.16.1.1
  # dns-* options are implemented by the resolvconf package, if installed
  dns {‘nameservers’: [‘8.8.8.8’, ‘8.8.4.4’, ‘2001:4860:4860::8888’, ‘2001:4860:4860::8844’], ‘search’: []}
  dns-search unassigned-domain
 

iface enp1s0f0 inet6 static
  address 2a0a:8dc0:2000:108::2
  netmask 126
  gateway 2a0a:8dc0:2000:108::1
 
iface enp1s0f0 inet6 static
  address 2a0a:8dc0:2108::a/48
 
iface enp1s0f0 inet6 static
  address 2a0a:8dc0:2108::b/48

 

Restart the networking service to commit the changes:

systemctl restart networking

 

Alma Linux 8 & 9 / Rocky Linux 8 & 9 (NetworkManager) #

IPv6 can be configured direct from the command line…

Add the main IP /126 address:

nmcli connection modify enp1s0f0 ipv6.addresses “2a0a:8dc0:2000:108::2/126” ipv6.method manual

Add the gateway:

nmcli connection modify enp1s0f0 ipv6.gateway “2a0a:8dc0:2000:108::1”

First IP from the /48 subnet:

nmcli connection modify enp1s0f0 +ipv6.addresses “2a0a:8dc0:2108::a/48” ipv6.method manual

Second IP from the /48 subnet:

nmcli connection modify enp1s0f0 +ipv6.addresses “2a0a:8dc0:2108::b/48” ipv6.method manual

Add IPv6 DNS servers:

nmcli connection modify enp1s0f0 ipv6.dns “2001:4860:4860::8888 2001:4860:4860::8844”

Restart the service to load the new config:

systemctl restart NetworkManager

 

Windows Server 2022 #

Navigate to the Properties page of the connected network adapter, select Internet Protocol Version 6 (TCP/IPv6) and click Properties.

Enter the main IP and gateway addresses, and the DNS servers:

To add IP addresses from the subnet, click the Advanced button to bring up the Advanced TCP/IP Settings:

Click the Add button in the IP Addresses section to add an IP address: