Vultr offers cloud servers with elastic SSD storage for all their customers. Vultr provides an advanced cloud platform to deliver hosting services and cloud infrastructure for businesses and developers. Vultr fascinates users with 100% SSD storage, One-click deployment, and fully automated and dedicated servers. Vultr also offers a user-friendly dashboard with a very reasonable price tag when compared to its competitors. Vultr’s features and the affordable price tag make it a trustworthy option for limited budget and small-scale ventures.
Vultr supports IPv6 for all of its Virtual Private Servers (VPS) and Bare Metal instances. To enable IPv6, users can either use any of these methods:
- Select the Enable IPv6 option in the Additional Features section when deploying a new instance.
- Use this tutorial to add IPv6 support or add a secondary address to a deployed instance.
In this tutorial, we learn the steps to configure IPv6 on Ubuntu and CentOS servers in Vultr.
Add IPv6 to an Instance
To add IPv6 to a Virtual Private Server instance in Vultr, follow the below steps:
1. Verify that the ICMP protocol is not blocked in the OS firewall as the IPv6 autoconfiguration depends on the ICMP protocol.
2. Log in to the Vultr console and navigate to the Settings tab for the instance.
3. From the settings page, select the IPv6 menu.
4. Next, click the Assign IPv6 Network button.
5. Finally, restart the server via the Vultr Customer Portal. Note that rebooting the server via SSH doesn’t activate the new network.
Ubuntu
Ubuntu 17.10 through 20.10
1. Open the /etc/netplan/10-ens3.yaml file and add the following text.
network: version: 2 renderer: networkd ethernets: ens3: dhcp4: yes addresses: - '2001:db8:1000::200/64'
· The primary IPv6 is dynamic.
· 2001:db8:1000::200 in the above text is the optional static secondary IPv6. Remove the addresses and the example IPv6 section from the above text if the secondary address isn’t required. Users can replace the example IPv6 address with an address in their IPv6 subnet.
2. After adding the text, save and exit the file.
3. Finally, update networking by executing the following command or reboot.
netplan apply
Ubuntu 16.04 through 17.04
1. To add IPv6 dynamic configuration, add the below lines to the /etc/network/interfaces file.
iface ens3 inet6 auto
2. After that, restart networking or reboot to ensure that the changes are reflected.
systemctl restart networking.service
3. To add IPv6 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
· 2001:db8:1000::100 is the primary IPv6. Replace this address with an address in the user’s IPv6 subnet.
· 2001:db8:1000::200 is the optional secondary IPv6. Remove the example IP address line if a secondary address isn’t required. Replace this address with an address in the user’s IPv6 subnet.
4. Save and exit the file.
5. Finally, restart networking or reboot the instance to reflect the changes.
systemctl restart networking.service
Ubuntu 14.04
1. To add IPv6 dynamic configuration, add the below lines to the /etc/network/interfaces file.
iface eth0 inet6 auto
2. Save and exit the file.
3. Reboot the instance to ensure that the changes are reflected.
systemctl restart networking.service
4. To add IPv6 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
· 2001:db8:1000::100 is the primary IPv6. Replace this address with an address in the user’s IPv6 subnet.
· 2001:db8:1000::200 is the optional secondary IPv6. Remove the example IP address line if a secondary address isn’t required. Replace this address with an address in the user’s IPv6 subnet.
5. Save and exit the file.
6. Finally, reboot the instance to reflect the changes.
IP Forwarding
If the user has enabled IP forwarding, such as when using the server as a VPN, add the following lines to the /etc/sysctl.conf file:
net.ipv6.conf.all.accept_ra=2 net.ipv6.conf.eth0.accept_ra=2
The default value for these variables is 1, which prevents IPv6 from working. To verify the status of IP forwarding, execute the following command:
# sysctl net.ipv4.ip_forward
CentOS
CentOS 8
1. In order to add IPv6 dynamic configuration, add the following lines to the /etc/sysconfig/network-scripts/ifcfg-ens3 file.
TYPE="Ethernet" DEVICE="ens3" ONBOOT="yes" BOOTPROTO="dhcp" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6ADDR_SECONDARIES="2001:db8:1000::100 2001:db8:1000::200"
- The primary IPv6 is dynamic.
- 2001:db8:1000::200 is the optional secondary IPv6. Remove the example IP address line if a secondary address isn’t required. Replace this address with an address in the user’s IPv6 subnet.
2. Save and exit the file.
3. Finally, restart the connection or reboot to reflect the changes.
nmcli con load /etc/sysconfig/network-scripts/ifcfg-ens3 nmcli con up 'System ens3'
CentOS 6 through 7
1. In order to add IPv6 dynamic configuration, 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"
- 2001:db8:1000::100 is the primary IPv6. Replace this address with an address in the user’s IPv6 subnet.
- 2001:db8:1000::200 is the optional secondary IPv6. Remove the IPV6ADDR_SECONDARIES line if a secondary address isn’t required. Replace this address with an address in the user’s IPv6 subnet.
2. Save and exit the file.
3. Finally, restart the connection or reboot to reflect the changes.
service network restart
IP Forwarding
If the user has enabled IP forwarding, such as when using the server as a VPN, add the following lines to the /etc/sysctl.conf file:
net.ipv6.conf.all.accept_ra=2 net.ipv6.conf.eth0.accept_ra=2
The default value for these variables is 1, which prevents IPv6 from working. To verify the status of IP forwarding, execute the following command:
# sysctl net.ipv4.ip_forward
Conclusion
This tutorial presents the process to configure IPv6 on Ubuntu and CentOS servers in Vultr. Hope this tutorial was helpful, and do reach out to us if you have any query or suggestions.