var img = document.createElement('img'); img.src = "https://easystat.de/piwik.php?idsite=13&rec=1&url=https://docs.vps2day.com" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

How to configure IPv6 on Debian

When using a virtual private server (VPS) from VPS2day it's usually not necessary to manually configure IPv6, because it's automatically configured by us upon provisioning. However, if you want to learn how to configure IPv6 on a Debian server, this is the right tutorial to follow along. The tutorial assumes that you want to configure a static IPv6 address instead of obtaining one via Router Advertisement (RA).

note

This tutorial requires you to know how to edit a file. If you're unfamiliar with this, please read our tutorial on how to edit a file in Linux, first.

First, open the network configuration file under /etc/network/interfaces.d/eth0 using your favorite text editor. If you're not logged as root you might want to prefix the command with sudo to run it with elevated privileges. The file name might be different on your system, depending on the name of your network adapter. In this tutorial we assume that your primary network interface is called eth0. If your network adapter has a different name, please replace eth0 with the correct name.

sudo nano /etc/network/interfaces.d/eth0

Add the following lines at the end of the file, replacing the placeholder values with your own settings:

iface eth0 inet6 static
address <IPv6 address>/<IPv6 prefix>
gateway <IPv6 gateway>
info

For VPS2day servers, no manual configuration is required. The IPv6 address and gateway are automatically configured via RA (Router Advertisement) using a SLAAC address without privacy extensions.

Save the file and exit the text editor.

In order to activate your changes, restart the network service to apply the changes:

sudo systemctl restart networking
warning

If you are configuring the settings via SSH, it’s normal that the session may be frozen for a few seconds. Please double-check all settings before restarting the network service. If you mis-configure your network settings, you may have to use a VNC console to fix the settings because your server might lose its network connectivity. You can learn more about the VPS2day VNC console here.

Your Debian system should now be configured with a static IPv6 address and gateway, while still obtaining its IPv4 address via DHCP.