I'm configuring a dual stack network on a KVM server using static IPv4 and IPv6 addresses furnished by my provider.

I input all addresses, nameservers and gateways as required when installing Ubuntu. After that, I checked the /etc/network/interfaces file and noticed that the IPv6 stanza was absent (an ifconfig execution confirmed this), so I added the relevant lines. This is the final file:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        # dns-* options are implemented by the resolvconf package, if installed
        dns-search mydomainname.com
iface eth0 inet6 static
        pre-up modprobe ipv6
        address 2001:b60:1000:151:236:18:86:0
        netmask 112
        gateway 2001:b60:1000::1
        dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
        dns-search mydomainname.com

I then restarted networking via sudo /etc/init.d/networking stop && sudo /etc/init.d/networking restart and noticed that, while IPv4 was working, outbound IPv6 connectivity was not available (I did not check for inbound connectivity yet).

ifconfig and ip -6 addr show the IPv6 address is recognized:

eth0      Link encap:Ethernet  HWaddr 52:54:00:b1:27:87  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::5054:ff:feb1:2787/64 Scope:Link
          inet6 addr: 2001:b60:1000:151:236:18:86:0/112 Scope:Global
          RX packets:16409 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1178 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1126656 (1.1 MB)  TX bytes:763658 (763.6 KB)

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:b60:1000:151:236:18:86:0/112 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:feb1:2787/64 scope link 
       valid_lft forever preferred_lft forever

On the contrary, no default route exists for the IPv6 stack:

$ ip -6 route
2001:b60:1000:151:236:18:86:0/112 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 

Trying to add the missing route leads to "No route to host" error:

$ sudo ip -6 route add default via 2001:b60:1000::1
RTNETLINK answers: No route to host

What could be wrong, and how can I fix the network configuration so that I can get the IPv6 stack working?

3 Answers 3


Inside your virtual machine, run the following:

ping6 ff02::2%eth0

This ff02::2 is the IPv6 "all routers" multicast address. The on-link router will respond to the ping with its own address. For example:

64 bytes from fe80::56e6:fcff:fef4:66f1: icmp_seq=1 ttl=64 time=0.347 ms

You can then add this in as the gateway address.

iface eth0 inet6 static
        gateway fe80::56e6:fcff:fef4:66f1
  • I did that, three routers responded (no one matched the gateway address my provider gave me); I chose the one with the lowest latency and changed the network configuration. Now name resolution works, but IPv6 connectivity does not (I issued ping6 -c 3 ipv6.google.com, the DNS found the address but there was 100% packet loss). Any ideas? Aug 10, 2013 at 8:34
  • Three different routers responded? Your provider has an even more bizarre setup than we'd suspected. At this point I can only suggest you try each of them, and see if one of them works. If none of them work, you'll have to contact the provider to ask them to kindly fix their broken network. :) Aug 10, 2013 at 10:58

Your netmask should be 64. With IPv6 every LAN is usually a /64. I guess your provider allows you to use a /112 from that /64, but you should configure a /64 on the interface.

  • I reconfigured the IPv6 stack to use a /64 netblock, unfortunately the problem persists with the same symptoms. Aug 4, 2013 at 9:19
  • I am sorry, I now see that your host is in 2001:b60:1000:151::/64 and your gateway in 2001:b60:1000:0::/64. CDLAN must have given you the wrong information, or their IPv6 network is messed up and/or deviating from standard practice... Aug 4, 2013 at 13:59
  • 1
    This weird deviation is, unfortunately, all too common among VPS providers. Aug 10, 2013 at 0:16

It turned out that the network mask length given to me by the provider was incorrect: the right one was 48. Changing it did the trick.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .