Hurricane Electric's IPv6 Tunnel Broker Forums

General IPv6 Topics => IPv6 on Linux & BSD & Mac => Topic started by: rm on June 07, 2012, 04:01:18 AM

Title: Cached route overrides manually-added one?
Post by: rm on June 07, 2012, 04:01:18 AM
Hello,

I'm having a strange routing problem, hope someone can help.

root@rin:~# ip route get 2001:470:aaaa::100
2001:470:aaaa::100 via 2001:470:aaaa::100 dev henet  src 2001:470:24:bbb::1  metric 0
    cache  mtu 1480 advmss 1420 hoplimit 0


Now I need to add a route so that this IP and some subnet including it is accessed not via the default route, but over a VPN interface (and a ULA-addressed router inside the VPN):
root@rin:~# ip -6 route add 2001:470:aaaa::/52 via fd14:8086:1337::100 dev tun-rm

But that has no effect:
root@rin:~# ip route get 2001:470:aaaa::100
2001:470:aaaa::100 via 2001:470:aaaa::100 dev henet  src 2001:470:24:bbb::1  metric 0
    cache  mtu 1480 advmss 1420 hoplimit 0

Why it is completely ignored, and the cached route continues to be used?

The complete routing table:
root@rin:~# ip -6 route
2001:470:24:bbb::/64 dev henet  metric 256  expires 21262229sec mtu 1480 advmss 1420 hoplimit 0
2001:470:aaaa::/52 via fd14:8086:1337::100 dev tun-rm  metric 1024  expires 21334303sec mtu 1500 advmss 1440 hoplimit 0
fd14:8086:1337::/64 dev tun-rm  metric 256  expires 21262224sec mtu 1500 advmss 1420 hoplimit 0
fe80::/64 dev tun-rm  metric 256  expires 21262224sec mtu 1500 advmss 1420 hoplimit 0
fe80::/64 dev henet  metric 256  expires 21262229sec mtu 1480 advmss 1420 hoplimit 0
default dev henet  metric 1024  expires 21262229sec mtu 1480 advmss 1420 hoplimit 0

(why they even have these "expires" values??)

So if I will do "ip -6 route flush cache" at this point, the cached route will go away, and everything will work as I want it to (routing over the VPN).
The problem is, the cached route as shown above will "return" on itself after several days of operation, breaking the routing again in the same manner.
Any idea what is going on here?
Title: Re: Cached route overrides manually-added one?
Post by: jtcloe on June 07, 2012, 04:14:29 AM
Try specifying a lower metric of zero on the manually added route.
Title: Re: Cached route overrides manually-added one?
Post by: rm on June 07, 2012, 04:20:42 AM
Hello,
QuoteTry specifying a lower metric of zero on the manually added route.
The lowest metric that can be manually specified is 1, when using metric 0 the route gets added with a metric of 1024. E.g.
rm@rm:~$ sudo ip -6 route add 2001:db8::/32 dev eth0 metric 0
rm@rm:~$ sudo ip -6 route | grep db8
2001:db8::/32 dev eth0  metric 1024
Title: Re: Cached route overrides manually-added one?
Post by: jtcloe on June 07, 2012, 08:48:44 PM
Oh yeah...  OK, try one then.

The point is that the cached entries have metric's much higher, and the lower one wins.
Title: Re: Cached route overrides manually-added one?
Post by: rm on June 07, 2012, 09:25:18 PM
I have tried 1 in the past, and it didn't help. Besides, the cached route still has a higher metric of 0.