Unexpected behavior of static routes

Alexander Demenshin aldem-bird.201704 at nk7.net
Wed May 10 17:14:13 CEST 2017


On 2017-05-10 13:16, Ondrej Zajicek wrote:

> But such design would bring plenty of issues w.r.t. multiple routing
> tables - may next hops resolve just in the same routing table or also 
> in
> another routing table?

Well, at least in Linux device/direct routes may exist in any table,
so where is the difference between device/direct routes and arbitrary
next-hop route?

How I would implement this:

- Try to find if next-hop is routable via any of existing devices
   (including explicitly routed networks - as in my case);
- If it is routable (which also means that device has to be up),
   install it (so it can be exported to the kernel tables).

> What if the device route is available, but not exported to kernel?

You mean if it is configured but not exported? Then it should be
ignored, obviously, though this could happen only in few cases:
- device does not exists (yet)
- device is not up (kernel will not accept any routes in this case)
- protocol is disabled

If no kernel export is configured at all then the route does not make 
any
sense anyway.

> Static onlink routes is something that probably could be implemented 
> and
> it is a good idea.

This could solve one of the most typical scenarios - keep static (local) 
routes
up for specified set of devices/gateways - once they become available.

What is interesting, quagga behaves exactly in the same way as bird,
and only cisco (well, may be other routers too) does what is (logically)
expected - and it allows Linux-like onlink routes, which specify
both device and gateway address, and those routes are linked to device
state (i.e. exported and used when device is active).

---
Best regards,
Alexander.



More information about the Bird-users mailing list