Unexpected behavior of static routes

Damien Clabaut damien.clabaut at corp.ovh.com
Fri Aug 4 20:41:32 CEST 2017


Hello everyone,

I am reopening the subject as I am facing the same issue that was 
described here.

I add routes in Linux:

interface bond0.2 has no ip address assigned, by design.

# ip route add 10.0.2.0/24 dev bond0.2  scope link

# ip r a 192.168.0.1 via 10.0.2.2 dev bond0.2

How can I import the second route to Bird, to be able to announce it via 
BGP ?

I am working on latest stable (1.6.3).

Regards,


On 10/05/17 11:14 AM, Alexander Demenshin wrote:
> 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.
>

-- 
Damien Clabaut
R&D vRouter
ovh.qc.ca



More information about the Bird-users mailing list