bird does not install route to the kernel

Ondrej Zajicek santiago at crfreenet.org
Tue Sep 13 22:06:18 CEST 2016


On Tue, Sep 13, 2016 at 10:07:54PM +0300, Volodymyr Samodid wrote:
> 
> I found misconfiguration in that schema.
> 
> "device routes" option for kernel protocol  allows install such route.

Hi

Generally, if you add local IP address/prefix, Linux kernel will add
appropraite device route itself [1]. That is the reason why BIRD kernel
protocol avoids to interfere with device routes unless explicitly enabled.
I have no idea why the device route was not added by Linux in your case.


# ip a add 2001:DB8::1/64 dev eth0

# ip -6 r l
2001:db8::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 


Actually, i have one idea that could explain the behavior - if you added 
2001:DB8::1/64 on both R0 and R1 while OSPF is already active and
associated, the sequence could look like:

1) first you add the prefix (call it N) on say R1

2) N is immediately propagated by OSPF to R0, where OSPF generates a
regular route for N (directed to R1) and that is pushed to kernel.

3) After that, you add the prefix N on R0

4) Linux kernel on R0 genrerates device route for N

5) Now, you have two routes for N in Linux kernel routing table,
one regular route from OSPF, one device from kernel.

6) BIRD on R0 notices new local IP address with prefix N, OSPF recomputes
its routing table and replaces regular route for N directed to R1 with
device route for N.

7) BIRD kernel protocol tries to remove old regular route for N from
kernel routing table. New device route is not pushed due to 'device
routes' option disabled.

8) Now a Linux kernel bug comes - instead of removing regular BIRD route for N,
it removes its own device route. I noticed this bug just several days ago.
Route remove request contains a protocol field, which should filter applicable
routes for removal. This works on IPv4, but is ignored on IPv6.

9) During periodic scan, BIRD notices that there is a regular BIRD route
for N in the kernel routing table, (which should not be here and should
be removed in the previous step) and removes it again, successfully.

10) You end with no route for N in Linux kernel table.


I am currently working on kernel protocol option that allows to
workaround the issue by using explicit kernel metric for all BIRD routes.


-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20160913/fd0461f1/attachment.asc>


More information about the Bird-users mailing list