Each of these examples assume an IPv6 subnet of 2001:db8:1000::/64. You will need to update them with the subnet that you have been assigned.

We will be using 2001:db8:1000::100 as the main IPv6 address to assign. We will also be configuring 2001:db8:1000::200 as a secondary IPv6 address. Adding a secondary IPv6 is not necessary, but it shows the process you would use if you wanted multiple IPv6 addresses.

Important Note: If you add an IPv6 subnet to an existing machine, you must restart the server via the Vultr control panel before IPv6 will work. Restarting via SSH or similar is not sufficient. IPv6 would not work at all until the server has been restarted. This does not apply if you have selected IPv6 during the initial server deployment.

In the Vultr control panel, there are configuration examples generated for each of your VMs. These are located under the VM's IPv6 settings, labeled "See configuration examples or documentation.".

CentOS 6, CentOS 7

Add the following lines to the /etc/sysconfig/network-scripts/ifcfg-eth0 file.

IPV6INIT="yes"
IPV6ADDR="2001:db8:1000::100/64"
IPV6_AUTOCONF="yes"
IPV6ADDR_SECONDARIES="2001:db8:1000::200/64"

Restart networking or reboot.

service network restart

If you have IP forwarding enabled (using your server as a VPN or similar), you will also need to add the following lines to the /etc/sysctl.conf file. The default settings for these variables (which is 1), prevents IPv6 from working properly when IP forwarding is enabled. You can check if IP forwarding is enabled by running "sysctl net.ipv4.ip_forward".

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

Debian 8

Dynamic configuration

For dynamic configuration, add the following lines to the /etc/network/interfaces file.

iface eth0 inet6 auto

Restart networking or reboot.

systemctl restart networking.service

Static configuration

For static configuration, add the following lines to the /etc/network/interfaces file.

iface eth0 inet6 static
address 2001:db8:1000::100
netmask 64
up /sbin/ip -6 addr add dev eth0 2001:db8:1000::200

Restart networking or reboot.

systemctl restart networking.service

Debian 9

Dynamic configuration

For dynamic configuration, add the following lines to the /etc/network/interfaces file.

iface ens3 inet6 auto

Restart networking or reboot.

systemctl restart networking.service

Static configuration

For static configuration, add the following lines to the /etc/network/interfaces file.

iface ens3 inet6 static
address 2001:db8:1000::100
netmask 64
up /sbin/ip -6 addr add dev ens3 2001:db8:1000::200

Restart networking or reboot.

systemctl restart networking.service

Fedora 26 - Fedora 28

Add the following lines to the /etc/sysconfig/network-scripts/ifcfg-ens3 file.

IPV6INIT="yes"
IPV6ADDR="2001:db8:1000::100/64"
IPV6_AUTOCONF="yes"
IPV6ADDR_SECONDARIES="2001:db8:1000::200/64"

Restart networking or reboot.

systemctl restart network.service

Fedora 29, Fedora 30

Run the following commands for dynamic IPv6 configuration, and one additional IPv6 address (/128). Additional addresses can be added in the same fashion.

nmcli con mod 'Wired connection 1' ipv6.method 'auto' ipv6.addresses ''
nmcli con mod 'Wired connection 1' +ipv6.addresses '2001:db8:1000::200/128'
nmcli con up 'Wired connection 1'

FreeBSD 10.x, FreeBSD 11.x, FreeBSD 12.x

Dynamic configuration

For dynamic configuration, add the following lines to the /etc/rc.conf file.

ifconfig_vtnet0_ipv6="inet6 accept_rtadv"
ipv6_activate_all_interfaces="YES"
rtsold_enable="YES"
rtsold_flags="-aF"

Start the router solicitation daemon or reboot.

service rtsold start

Static configuration

For static configuration, add the following lines to the /etc/rc.conf file.

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:db8:1000::200 prefixlen 64"

Start the router solicitation daemon or reboot.

service rtsold start

OpenBSD 6.0 - OpenBSD 6.2

Add the following lines to the /etc/hostname.vio0 file.

inet6 autoconf -autoconfprivacy
inet6 alias 2001:db8:1000::200 64

Restart the interface or reboot.

sh /etc/netstart vio0

OpenBSD 6.3 - OpenBSD 6.5

Add the following lines to the /etc/hostname.vio0 file.

inet6 autoconf -autoconfprivacy -soii
inet6 alias 2001:db8:1000::200 64

Restart the interface or reboot.

sh /etc/netstart vio0

Ubuntu 14.04

Dynamic configuration

For dynamic configuration, add the following lines to the /etc/network/interfaces file.

iface eth0 inet6 auto

Reboot the instance.

Static configuration

For static configuration, add the following lines to the /etc/network/interfaces file.

iface eth0 inet6 static
address 2001:db8:1000::100
netmask 64
up /sbin/ip -6 addr add dev eth0 2001:db8:1000::200

IP forwarding

If you have IP forwarding enabled (using your server as a VPN or similar), you will also need to add the following lines to the /etc/sysctl.conf file. The default settings for these variables (which is 1), prevents IPv6 from working properly when IP forwarding is enabled. You can check if IP forwarding is enabled by running "sysctl net.ipv4.ip_forward".

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

Ubuntu 16.04

Dynamic configuration

For dynamic configuration, add the following lines to the /etc/network/interfaces file.

iface ens3 inet6 auto

Restart networking or reboot.

systemctl restart networking.service

Static configuration

For static configuration, add the following lines to the /etc/network/interfaces file.

iface ens3 inet6 static
address 2001:db8:1000::100
netmask 64
up /sbin/ip -6 addr add dev ens3 2001:db8:1000::200

Restart networking or reboot.

systemctl restart networking.service

Ubuntu 17.10, Ubuntu 18.xx, Ubuntu 19.xx

Populate the /etc/netplan/10-ens3.yaml file with the following text.

network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: yes
      addresses:
        - '2001:db8:1000::200/64'

Update networking or reboot.

netplan apply

Windows Server 2012 R2, Windows Server 2016

Find the public interface name on your system. You can use ipconfig /all or navigate the Windows Control Panel.

Replace "Ethernet" with the public interface name that Windows has chosen and run the following commands.

netsh interface ipv6 set global randomizeidentifiers=disabled
netsh interface ipv6 add address interface="Ethernet" address="2001:db8:1000::100/64"
netsh interface ipv6 add address interface="Ethernet" address="2001:db8:1000::200/64"
هل كانت المقالة مفيدة ؟ 0 أعضاء وجدوا هذه المقالة مفيدة (0 التصويتات)