Skip to content

Configure your routed /48 IPv6 prefix ​

A server comes with a routed /48 IPv6 subnet, routed to its primary IPv6 address. This guide brings an address from the /48 up on Debian/Ubuntu, CentOS/RHEL, FreeBSD and Windows.

Understanding your IPv6 setup ​

The examples use a server with the IPv4 address 185.181.60.123:

FieldValue
Primary IPv62a03:94e0:ffff:185:181:60::123
Prefix length on primary/118
Default gateway2a03:94e0:ffff:185:181:60::1
Routed /48 subnet2a03:94e0:abcd::/48

Replace 2a03:94e0:abcd::/48 with the routed prefix under Subnets on the server's Network tab.

Linux ​

Debian / Ubuntu ​

Open the network interfaces file:

bash
sudo nano /etc/network/interfaces

You should already see the primary IPv6 stanza:

iface eth0 inet6 static
    address 2a03:94e0:ffff:185:181:60::123
    netmask 118
    gateway 2a03:94e0:ffff:185:181:60::1

Add an alias interface for an address inside the routed /48:

iface eth0:1 inet6 static
    address 2a03:94e0:abcd::1
    netmask 48

Replace eth0 with your actual interface name (for example ens33, ens160).

Restart networking:

bash
sudo systemctl restart networking

Debian 12+ / Ubuntu 22.04+ with netplan ​

Edit /etc/netplan/01-netcfg.yaml:

yaml
network:
  version: 2
  ethernets:
    ens33:
      addresses:
        - 2a03:94e0:ffff:185:181:60::123/118
        - 2a03:94e0:abcd::1/48
      routes:
        - to: default
          via: 2a03:94e0:ffff:185:181:60::1

Apply:

bash
sudo netplan apply

CentOS / RHEL ​

Edit your interface config:

bash
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

Add the secondary IPv6 address:

IPV6ADDR_SECONDARIES="2a03:94e0:abcd::1/48"

Replace eth0 with your real interface name (ens192, eno1, etc.).

Restart the network service:

bash
sudo systemctl restart network

CentOS 8+ / RHEL 8+ with nmcli ​

bash
nmcli connection modify eth0 +ipv6.addresses 2a03:94e0:abcd::1/48
nmcli connection up eth0

FreeBSD ​

Edit /etc/rc.conf:

bash
sudo nano /etc/rc.conf

Add the IPv6 stanzas:

ipv6_ifconfig_em0="inet6 2a03:94e0:ffff:185:181:60::123 prefixlen 118"
ipv6_defaultrouter="2a03:94e0:ffff:185:181:60::1"
ipv6_ifconfig_em0_alias0="inet6 2a03:94e0:abcd::1 prefixlen 48"

Replace em0 with your actual interface name.

Restart networking:

bash
sudo service netif restart

Windows ​

Open PowerShell as Administrator and run:

powershell
New-NetIPAddress -InterfaceAlias "Ethernet" `
                 -IPAddress      "2a03:94e0:abcd::1" `
                 -PrefixLength   48 `
                 -DefaultGateway "2a03:94e0:ffff:185:181:60::1"

Replace "Ethernet" with your actual adapter name. Run Get-NetAdapter to list them.

Verify ​

After reloading, confirm the address is up:

OSCommand
Linuxip -6 addr
FreeBSDifconfig
WindowsGet-NetIPAddress

Test connectivity from the new address:

bash
ping6 google.com

TIP

Once an address from the /48 is up on your server, the next step for many use-cases (especially mail) is to set reverse DNS (PTR) for it.

Gigahost Docs

This site is currently in development.
Enter the password to continue.