BIRD removing BGP routes from other daemon - FreeBSD
Hello, I have a particular scenario where my BGP runs with OpenBGP and I can not change it right now. However I want BIRD to use OSPF and BFD. While BIRD works perfectly, better than OpenOSPF for my scenario, when I start it, it completely removes all routes installed by OpenBGP. My kernel context has learn, persist and import: protocol kernel { learn; persist; scan time 10; import all; #export all; graceful restart on; } What should I do to keep BIRD co-operating with other routing daemons? Thank you.
On Thu, Jun 18, 2015 at 05:14:41PM -0300, Cassiano Peixoto wrote:
Hello,
I have a particular scenario where my BGP runs with OpenBGP and I can not change it right now.
However I want BIRD to use OSPF and BFD. While BIRD works perfectly, better than OpenOSPF for my scenario, when I start it, it completely removes all routes installed by OpenBGP.
Hello On BSD systems, BIRD uses PROTO1 route flag to identify 'its' routes. If OpenBGP uses the same flag, then they mix-up their routes. Currently there is no option in BIRD to change it to use PROTO2 or PROTO3 flag [*], i don't know about OpenBGP. I wonder if there is a better way to distinguish route ownership in BSD systems (like there is u8 rtm_protocol field in Linux). [*] Could be changed in the source code on these lines in sysdep/bsd/krt-sock.c: msg.rtm.rtm_flags = RTF_UP | RTF_PROTO1; ... u32 self_mask = RTF_PROTO1; -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
25.06.2015, 10:41, "Ondrej Zajicek" <santiago@crfreenet.org>:
On Thu, Jun 18, 2015 at 05:14:41PM -0300, Cassiano Peixoto wrote:
Hello,
I have a particular scenario where my BGP runs with OpenBGP and I can not change it right now.
However I want BIRD to use OSPF and BFD. While BIRD works perfectly, better than OpenOSPF for my scenario, when I start it, it completely removes all routes installed by OpenBGP.
Hello
On BSD systems, BIRD uses PROTO1 route flag to identify 'its' routes. If OpenBGP uses the same flag, then they mix-up their routes. Currently there is no option in BIRD to change it to use PROTO2 or PROTO3 flag [*], i don't know about OpenBGP. I wonder if there is a better way to distinguish route ownership in BSD systems (like there is u8 rtm_protocol field in Linux). Well, there is auto-filled rtm_pid field, so theoretically we can check if this pid (if filled) and flush routes only if it is not currently running (yes, it is not ideal).
[*] Could be changed in the source code on these lines in sysdep/bsd/krt-sock.c:
msg.rtm.rtm_flags = RTF_UP | RTF_PROTO1; ... u32 self_mask = RTF_PROTO1;
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@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."
On Fri, Jun 26, 2015 at 11:19:31AM +0300, Alexander V.Chernikov wrote:
25.06.2015, 10:41, "Ondrej Zajicek" <santiago@crfreenet.org>:
On Thu, Jun 18, 2015 at 05:14:41PM -0300, Cassiano Peixoto wrote: i don't know about OpenBGP. I wonder if there is a better way to distinguish route ownership in BSD systems (like there is u8 rtm_protocol field in Linux).
Well, there is auto-filled rtm_pid field, so theoretically we can check if this pid (if filled) and flush routes only if it is not currently running (yes, it is not ideal).
That is a possibility, but it is more complicated (e.g. different ownership checking during initiation and later) and probably not worth the effort. Seems to me like adding option to make the flag configurable would be sufficient. The similar approach is used by route6d, so it seems that it is not completely silly approach. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
Hi Ondrej, Thanks for your help. I've changed as you suggested on sysdep/bsd/krt-sock.c to PROTO2 and i worked fine. I'd would like know what kind of problem i would have if i keep this change on my bird. Can i run into some issues with other protocols or systems? Thanks. On Thu, Jun 25, 2015 at 5:42 AM, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, Jun 18, 2015 at 05:14:41PM -0300, Cassiano Peixoto wrote:
Hello,
I have a particular scenario where my BGP runs with OpenBGP and I can not change it right now.
However I want BIRD to use OSPF and BFD. While BIRD works perfectly, better than OpenOSPF for my scenario, when I start it, it completely removes all routes installed by OpenBGP.
Hello
On BSD systems, BIRD uses PROTO1 route flag to identify 'its' routes. If OpenBGP uses the same flag, then they mix-up their routes. Currently there is no option in BIRD to change it to use PROTO2 or PROTO3 flag [*], i don't know about OpenBGP. I wonder if there is a better way to distinguish route ownership in BSD systems (like there is u8 rtm_protocol field in Linux).
[*] Could be changed in the source code on these lines in sysdep/bsd/krt-sock.c:
msg.rtm.rtm_flags = RTF_UP | RTF_PROTO1; ... u32 self_mask = RTF_PROTO1;
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@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."
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAlWLvuIACgkQw1GB2RHercNojACeMyUR2qqw0hdxiGNqNWujZOVd rPIAoIK5hu9xcnL09HB07sra+t48Vnvr =cMpO -----END PGP SIGNATURE-----
On Thu, Jul 02, 2015 at 08:30:01PM -0300, Cassiano Peixoto wrote:
Hi Ondrej,
Thanks for your help. I've changed as you suggested on sysdep/bsd/krt-sock.c to PROTO2 and i worked fine.
I'd would like know what kind of problem i would have if i keep this change on my bird. Can i run into some issues with other protocols or systems?
I have no idea. These PROTOx flags IMHO are not really well documented. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
participants (3)
-
Alexander V. Chernikov -
Cassiano Peixoto -
Ondrej Zajicek