2

I have a strange issue with ipv6 on Ubuntu 12.04.

There are two hosts, directly connected to the internet. Both have assigned a /64 network. They are properly configured with a /128 endpoint each and one can ping6 the other and vice versa. My plan was to terminate a /112 subnet of my assigned ipv6/64 to the interface to have plenty of addresses for usage in apache2 vhosts. But that's not the point.

Host A:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr (...)
          inet6 addr: fe80::5246:5dff:(...)/64 Scope:Link
          inet6 addr: 2a01:xxx:xxx:000A::2/64 Scope:Global

$ route -A inet6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
2a01:xxx:xx:000A::/64          ::                         U    256 0     0 eth0
fe80::/64                      ::                         U    256 0     0 eth0
::/0                           fe80::1                    UG   1024 0     0 eth0
::/0                           ::                         !n   -1  1  5689 lo
::1/128                        ::                         Un   0   1    18 lo
2a01:xxx:xx:000A::2/128        ::                         Un   0   1   202 lo
2a01:xxx:xx:000A::/112        ::                         U    1024 0     0 lo
fe80::5246:5dff:fea1:977c/128  ::                         Un   0   1    86 lo
ff00::/8                       ::                         U    256 0     0 eth0
::/0                           ::                         !n   -1  1  5689 lo

Host B can ping6 2a01:xxx:xx:000A::[0001-FFFF] correctly and works as I expected it. But on Host A, I cannot ping my own Addresses. If I try to ping6 2a01:xxx:xxx:000A::n, I get this one:

$ ping6 2a01:xxx:xxx:000A::3
PING (...) 56 data bytes
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument

I suspect the routing table, but I've played around with it a long time and even using google I can't get it work.

Any Ideas? Thanks.

t2m
  • 21
  • 2

1 Answers1

3

You have configured 2a01:xxx:xx:000a::/112 on lo. The most specific prefix wins* so you're trying to ping an IP address (::3) on your lo interface that isn't there. You should just configure all the addresses you need on eth0 and remove the /112 route and the /128 from lo.

*) How it works: Routing decisions are made by looking up the "most specific" route. That means the route with the longest prefix mask. In your case:

2a01:xxx:xxx:000A::3

This address is contained in the following networks:

::/0                           fe80::1                    UG   1024 0     0 eth0
2a01:xxx:xx:000A::/64          ::                         U    256 0     0 eth0
2a01:xxx:xx:000A::/112        ::                         U    1024 0     0 lo

Most specific is the network with mask /112 so that is where the packet is routed. As this is your lo interface (and you don't have the IP configured there) the ping fails.