❦ 28 juin 2017 16:12 +0200, Vincent Bernat <bernat@luffy.cx> :
Note that when learning route from the kernel you could workaround it by using 'onlink' route flag.
Great!
It seems to work:
$ ip route show table public dev eth2 203.0.113.1 scope link metric 10 203.0.113.10 via 203.0.113.1 metric 10 onlink
bird> show route table public 203.0.113.10/32 via 203.0.113.1 on eth2 [kernel_public 15:58:09] * (200) 203.0.113.1/32 dev eth2 [kernel_public 15:58:09] * (200)
But BIRD (1.6.3) still seems to be a bit confused, since I got this message in a loop:
2017-06-28 16:01:20 <ERR> KRT: Received route 203.0.113.10/32 with strange next-hop 203.0.113.1 2017-06-28 16:01:20 <WARN> Netlink: File exists
Other than that, everything works as expected. I don't know how to interpret the first message (is it receiving two routes?) but the second message seems to say that it tries to reinstall the same route it received.
After investigating a bit more, the problem is triggered by the fact that BIRD doesn't install the route with the "onlink" attribute. I am using this kind of configuration to maintain a stripped version of the routing table for local use: table local_out; protocol kernel kernel_local_out { persist; import none; export filter { krt_prefsrc = loopback_private; accept; }; scan time 10; kernel table 100; table local_out; device routes yes; merge paths yes; } protocol pipe private_local_out { table private; peer table local_out; import none; export all; } protocol pipe public_local_out { table public; peer table local_out; import none; export filter { if proto = "kernel_public" then accept; reject; }; } So, when the route is copied to the "local_out" table, it is copied without the "onlink" parameter: $ ip route show table public dev eth2 203.0.113.1 scope link metric 10 203.0.113.10 via 203.0.113.1 metric 10 onlink $ ip route show table local-out dev eth2 203.0.113.1 proto bird scope link src 172.22.2.1 metric 10 203.0.113.10 via 203.0.113.1 proto bird src 172.22.2.1 metric 10 On the next pass, BIRD doesn't recognize it (KRT: Received route 203.0.113.10/32 with strange next-hop 203.0.113.1) and tries to install it again but it already exists (Netlink: File exists). I'll dig more to find a workaround. -- "Elves and Dragons!" I says to him. "Cabbages and potatoes are better for you and me." -- J. R. R. Tolkien