How to enable IPv6 inside your KVM Debian, Ubuntu and Fedora virtual server

How to enable IPv6 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. Consider a KVM VPS server from First2Host. Build the virtual server you require with the resources that you need and never pay for resources you’re not going to use again.

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

Linux VPS Server

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

enable IPv6

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?

How to enable IPv6 inside your KVM Debian, Ubuntu and Fedora virtual server
21 5 100%

IPs and Subnets VPS Servers

2 Comments

Comments are closed.

Select Language
SSD Reseller Web Hosting ★ Host 50 Domains ★ 50 Free SSL Certificates ★ Weekly Backups ★ Free Migrations In14 Day Free Trial
+