Debian has had native support for IPv6 since 2011, so it is not a surprise that Debian 13 trixie comes with a robust and flexible networking stack with excellent support for IPv6. While nowadays there are modern tools like NetworkManager and netplan, in this article, we will focus on the traditional and the most direct method when it comes to configuring servers or systems with minimal installations.

IPv6 with ifupdown

This method utilizes the ifupdown package to parse the configuration file /etc/network/interfaces and to manage network interfaces by bringing them up and down, respectively. So naturally, all we need to do is edit the configuration file to look like this:

auto lo
iface lo inet loopback
allow-hotplug ens3

# Dynamic IPv4 Configuration
iface ens3 inet dhcp

# Static IPv6 configuration
iface ens3 inet6 static
        address 2a01:e9XX:0:XXX::/64
        gateway 2a01:e9XX::1

Your ISP or hosting provider should provide the IPv6 address and the gateway. In our case, we offer a full /64 IPv6 subnet for each of our VPS hosting plans, from a parent /48 subnet from which the IPv6 gateway can be easily “calculated” since it is on the first /128 of the corresponding parent.

For example, if your allocated subnet is: 2a01:e940:0:ABC::/64 you just need to take the first part of that prefix 2a01:e940, and add ::1 to the end. Your gateway will therefore be 2a01:e940::1.

Once configured, save the file and reboot the network with:

sudo systemctl restart networking.service

Need an IPv6-Ready Debian 13 VPS server?

Adding additional IPv6 addresses

To add more IPv6 addresses to the same interface, you simply add more iface ens3 inet6 static stanzas. Although it may look like an error initially, this is the correct and documented method for ifupdown called interface aliasing. Here is a quick example:

..

# Secondary IPv6 Address
iface ens3 inet6 static
        address 2a01:e9XX:0:XXX::2/64

# Yet Another IPv6 Address
iface ens3 inet6 static
        address 2a01:e9XX:0:XXX::e/64

Once you reboot the networking service, the newly configured IPv6 addresses might not be reachable from external networks. This is because the network gateway doesn’t know your server is now using them. To solve this, you need to trigger the Neighbor Discovery Protocol (NDP). The easiest way is to send any network traffic from the new IP address, which forces your server to announce itself.

Pinging an external host is a perfect way to do this:

ping -6 -I 2a01:e9XX:0:XXX::2 black.host

If your setup requires utilizing the full /64 subnet, manualy pinging 18,446,744,073,709,551,616 address 🤯 is not a smart thing to do, so we strongly enourage you to take a look of a small tool we’ve created NDPD – Neighbor Discovery Protocol Daemon, which automates the entire neighbor solicitation process for you.

Key Considerations

Before you finish, please keep these important points in mind:

IPv4 Configuration

This guide assumes your server gets its IPv4 address automatically via DHCP iface ens3 inet dhcp. If you need to set a static IPv4 address, you would replace the DHCP line with a static stanza, similar in structure to the IPv6 configuration we’ve discussed earlier:

iface ens3 inet static
        address 2.59.22.221
        netmask 255.255.255.0
        gateway 2.59.22.1

Network Interface Name

We use ens3 as the example network interface name throughout this article. This is a common name on modern Debian systems, but your actual interface name could be different (e.g., eth0, ens18, or something else). You can find your correct interface name by running the command ip a or ip link in your terminal. Be sure to replace ens3 with your specific interface name in all configuration steps.

Was this article helpful?