How to enable IPv6 Debian inside your KVM Debian, Ubuntu, and Fedora virtual server
These KVM IPv6 settings are unique to our network and will not function with KVM virtual servers with other providers. This is the manual way of configuring IPv6 in your KVM NVMe VPS. Customers can use the “Reconfigure Networking” button to automatically setup IPv6.
To enable IPv6 on your Debian, Ubuntu or Fedora virtual server there are some slight changes you need to make to the interfaces file. As always backup your current configuration first so you can use the VNC to revert back any changes you have made.
Add an IPv6 resolver into your resolv.conf file. We’re using Googles. Just paste the nameservers to the bottom of the file and save
nano /etc/resolv.conf
nameserver;2001:4860:4860::8888
nameserver;2001:4860:4860::8844
Next, let’s open the interfaces file to add the required entries
nano /etc/network/interfaces
Copy the below code into a text document on your local PC so we can edit it. Once you have added the required information add all the code to the bottom of the interfaces file
iface eth0 inet6 static
address YOUR_IPV6
netmask IPV6_PREFIX
post-up /sbin/ip -f inet6 route add IPV6_GATEWAY dev eth0
post-up /sbin/ip -f inet6 route add default via IPV6_GATEWAY
pre-down /sbin/ip -f inet6 route del IPV6_GATEWAY dev eth0
pre-down /sbin/ip -f inet6 route del default via IPV6_GATEWAY
Example
This assumes your IPv6 address is 2607:5300:60:7889::ec6f:5a4b and the default gateway here is for kvm1.first2host.uk your actual gateway is displayed in your client area or you can ask our support team for it
iface eth0 inet6 static
address 2607:5300:60:7889::ec6f:5a4b
netmask 255.255.255.255
post-up /sbin/ip -f inet6 route add 2607:5300:60:78ff:ff:ff:ff:ff dev eth0
post-up /sbin/ip -f inet6 route add default via 2607:5300:60:78ff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del 2607:5300:60:78ff:ff:ff:ff:ff dev eth0
pre-down /sbin/ip -f inet6 route del default via 2607:5300:60:78ff:ff:ff:ff:ff
The file should now look like this

Now reboot the whole server and you should be able to then ping your IPv6 address. Just repeat the process to add more addresses to your KVM based virtual server.
[[email protected] ~]# ping6 2607:5300:60:7889::ec6f:5a4b
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=1 ttl=54 time=92.1 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=2 ttl=54 time=92.3 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=3 ttl=54 time=92.1 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=4 ttl=54 time=92.3 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=5 ttl=54 time=92.2 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=6 ttl=54 time=92.1 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=7 ttl=54 time=92.1 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=8 ttl=54 time=92.4 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=9 ttl=54 time=96.5 ms
64 bytes from 2607:5300:60:7889::ec6f:5a4b: icmp_seq=10 ttl=54 time=92.1 ms
To setup and enable IPv6 in a CentOS KVM virtual server please follow this guide
How was this article?
You might also like
More from Linux VPS Servers
How To Install phpIPAM Ubuntu and Debian Servers
phpIPAM is a great tool for managing IP address space. It's a free bit of software that will manage IPv4 …
How to configure additional IPs in a Debian 11 VPS
On Debian 11 instances, we removed the /etc/network/interfaces file and now configure interfaces using Cloud-init on boot. Discovery will send …
2 Comments
[…] For Debian, Ubuntu, Fedora kvm vps servers please follow this guide […]
[…] Enable IPv6 […]