overriding static routes in FreeBSD

Kajetan Staszkiewicz vegeta at tuxpowered.net
Tue Jun 15 11:35:37 CEST 2021


Hello group,

I'm running BIRD on FreeBSD and I came across a problem with overriding
static routes created outside of BIRD. The situation is that for
installation of the operating system (contacting repositories, Puppet
and some other services) system needs to have a static default gateway
but once the system is fully installed it runs BIRD and talks BGP to
core routers.

Default routes are created with the usual FreeBSD method:
[9:08:14] hwlb-awtest-01 ~/ # cat /etc/rc.conf.d/routing
defaultrouter="1.2.3.4"
ipv6_defaultrouter="a::f"

Routes are created with UGS flags:
[9:11:17] hwlb-awtest-01 ~/ # netstat -rn | grep default
default   1.2.3.4     UGS      public
default   a::f        UGS      public

Once BIRD is started the log gets full of those messages:
Jun 15 08:57:32 hwlb-awtest-01.ndco.ig.local bird[2216] KRT: Error
sending route 0.0.0.0/0 to kernel: File exists
Jun 15 08:57:50 hwlb-awtest-01.ndco.ig.local bird6[2213] KRT: Error
sending route ::/0 to kernel: File exists

I've looked at BIRD's source and I understand that BIRD replaces routes
using krt_replace_rte and krt_send_route, and that all routes managed by
BIRD have RTF_UP | RTF_PROTO1 flags. Those are not the flags created by
`route add` on FreeBSD by default. However if I make default routes with
those flags via `route add default 1.2.3.4 -proto1 -nostatic`, BIRD will
happily replace them.

Kernel protocol is configured with "learn" option.

Is this a bug? Or should I just adjust the static routes to be
BIRD-compatible?

-- 
| pozdrawiam / greetings | Powered by macOS, Debian and FreeBSD |
|  Kajetan Staszkiewicz  |  www: http://vegeta.tuxpowered.net   |
`------------------------^--------------------------------------'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20210615/e99f6022/attachment.sig>


More information about the Bird-users mailing list