How to Set Up IPv6 on a VPS

All of these examples assume the IPv
6 subnet is 2001:Db8:1000:/64. You will need to update them with the subnet assigned to you.

We will use 2001:Db8:1000:100 as the primary IP address to assign. We will also use 2001:19f0:4009:2001:1234 as the secondary IP address we are configuring. Adding a secondary IP is not necessary, but it shows the process you would use if you want multiple IPv
6 addresses.

Important note: If you add an IPv
6 subnet to an existing machine, you must reboot the server through the control panel before IPv
6 will work. Rebooting through SSH or a similar method is not sufficient. IPv
6 will not work at all until the server has been rebooted. This does not apply if you selected IPv
6 during the initial server deployment.

Windows:

netsh interface ipv6 set global randomizeidentifiers=disabled
netsh interface ipv6 add address interface="Local Area Connection" address="2001:DB8:1000::100/64"
netsh interface ipv6 add address interface="Local Area Connection" address="2001:19f0:4009:2001::1234/64"

CentOS:
In /etc/sysconfig/net-script/ifcfg-eth0, add the following lines:

IPV6INIT="yes"
IPV6ADDR="2001:DB8:1000::100/64"
IPV6_AUTOCONF="yes"
IPV6ADDR_SECONDARIES="2001:19f0:4009:2001::1234/64"

If IP forwarding is enabled (if you are using the server as a VPN or similar), you will need to add the following to /etc/sysctl.conf:

net.ipv6.conf.all.accept_ra=2
net.ipv6.conf.eth0.accept_ra=2

The default setting here (1) prevents IPv
6 from working properly when IP forwarding is enabled. You can check whether IP forwarding is enabled by running “sysctl
net.ipv4.ip_Forward”.

Debian/Ubuntu:
Add the following lines to /etc/network/interfaces:

iface eth0 inet6 static
address 2001:DB8:1000::100
netmask 64
up /sbin/ip -6 addr add dev eth0 2001:19f0:4009:2001::1234

If IP forwarding is enabled (if you are using the server as a VPN or similar), you will need to add the following to /etc/sysctl.conf:

net.ipv6.conf.all.accept_ra=2
net.ipv6.conf.eth0.accept_ra=2

The default setting here (1) prevents IPv
6 from working properly when IP forwarding is enabled. You can check whether IP forwarding is enabled by running “sysctl
net.ipv4.ip_Forward”.

FreeBSD:
Add the following lines to /etc/rc.conf:

rtsold_enable="YES"
ipv6_activate_all_interfaces="YES"
rtsold_flags="-aF"
ifconfig_vtnet0_ipv6="inet6 2001:DB8:1000::100 prefixlen 64"
ifconfig_vtnet0_alias0="inet6 2001:19f0:4009:2001::1234 prefixlen 64"

Leave a Comment

Your email address will not be published. Required fields are marked *

中文 EN
🚀

RedGate VPN

免费节点太挤太慢?
升级高速稳定专线

立即体验 →

告别卡顿

RedGate VPN
全球高速节点

免费下载 →
Scroll to Top