Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to understand what is the reason that in recent linux kernels there is ipv6 default route to loopback

::/0                           ::                         !n   -1  1     4 lo

is it to prevent loops ? Why there are two such routes in the output below ?

root@ubuntu:/# ip -6 route show table all
fd00:1::/64 dev eth0  proto kernel  metric 256  expires 2591833sec
fd00:1::/64 dev eth1  proto kernel  metric 256  expires 2591833sec
fd00:2::/64 via fd00:1::1 dev eth0  metric 1 
fe80::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth1  proto kernel  metric 256 
default via fe80::21f:12ff:fe31:5600 dev eth0  proto kernel  metric 1024  expires 1309sec
default via fe80::21f:12ff:fe31:5600 dev eth1  proto kernel  metric 1024  expires 1309sec
unreachable default dev lo  table unspec  proto kernel  metric -1  error -101
local ::1 via :: dev lo  table local  proto none  metric 0 
local fd00:1::250:56ff:fe8a:596a via :: dev lo  table local  proto none  metric 0 
local fd00:1::250:56ff:fe8a:596b via :: dev lo  table local  proto none  metric 0 
local fd00:1::18ec:2a1:3b2e:8302 via :: dev lo  table local  proto none  metric 0 
local fd00:1::59b1:42d0:b380:a32d via :: dev lo  table local  proto none  metric 0 
local fe80::250:56ff:fe8a:596a via :: dev lo  table local  proto none  metric 0 
local fe80::250:56ff:fe8a:596b via :: dev lo  table local  proto none  metric 0 
ff00::/8 dev eth0  table local  metric 256 
ff00::/8 dev eth1  table local  metric 256 
unreachable default dev lo  table unspec  proto kernel  metric -1  error -101
root@ubuntu:/# route -nA inet6           
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
fd00:1::/64                    ::                         UAe  256 0     1 eth0
fd00:1::/64                    ::                         UAe  256 0     0 eth1
fd00:2::/64                    fd00:1::1                  UG   1   0     0 eth0
fe80::/64                      ::                         U    256 0     0 eth0
fe80::/64                      ::                         U    256 0     0 eth1
::/0                           fe80::21f:12ff:fe31:5600   UGDAe 1024 0     0 eth0
::/0                           fe80::21f:12ff:fe31:5600   UGDAe 1024 0     0 eth1
::/0                           ::                         !n   -1  1     4 lo
::1/128                        ::                         Un   0   1    12 lo
fd00:1::250:56ff:fe8a:596a/128 ::                         Un   0   1     0 lo
fd00:1::250:56ff:fe8a:596b/128 ::                         Un   0   1     0 lo
fd00:1::18ec:2a1:3b2e:8302/128 ::                         Un   0   1     0 lo
fd00:1::59b1:42d0:b380:a32d/128 ::                         Un   0   1     0 lo
fe80::250:56ff:fe8a:596a/128   ::                         Un   0   1     0 lo
fe80::250:56ff:fe8a:596b/128   ::                         Un   0   1     0 lo
ff00::/8                       ::                         U    256 0     0 eth0
ff00::/8                       ::                         U    256 0     0 eth1
::/0                           ::                         !n   -1  1     4 lo
root@ubuntu:/# 

The output is form

root@ubuntu:/# uname -a
Linux ubuntu 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
share|improve this question

migrated from stackoverflow.com Mar 25 '13 at 7:16

This question came from our site for professional and enthusiast programmers.

    
It looks like this route is actually found in table unspec. You can see it with ip -6 route show table all. –  Celada Mar 25 '13 at 7:52
    
I know it is there but why ? –  user2206433 Mar 25 '13 at 9:33
    
I have no idea. :-( I was just hoping that my comment could provide a clue for yourself or someone else. –  Celada Mar 25 '13 at 10:21

1 Answer 1

As the flags !n indicate, this is a rejection of traffic to IN6ADDR_ANY. The meaning of this route entry is that the lo device will never be used as the default route.

The equivalent line in the ip route table shown here is:

unreachable default dev lo  table unspec  proto kernel  metric -1  error -101

(Also note that, as the man page warns you, the route command is obsolete and you should use ip route instead.)

share|improve this answer
    
Thanks for the answer why there are two exactly the same routes ? –  user2206433 Mar 27 '13 at 7:45
    
There are not two exactly the same routes. –  Michael Hampton Mar 27 '13 at 10:42
    
take a look for the unreachable default dev lo table unspec proto kernel metric -1 error -101 its there two times –  user2206433 Mar 27 '13 at 18:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.