misleading documentation for the "direct" protocol
hello, the BIRD documentation says for the "direct" protocol[0]:
The question is whether it is a good idea to have such device routes in BIRD routing table. OS kernel usually handles device routes for directly connected networks by itself so we don't need (and don't want) to export these routes to the kernel protocol. OSPF protocol creates device routes for its interfaces itself and BGP protocol is usually used for exporting aggregate routes. But the Direct protocol is necessary for distance-vector protocols like RIP or Babel to announce local networks.
[0] https://bird.network.cz/?get_doc&v=30&f=bird-6.html#ss6.7 as i read this, it is suggesting that if BIRD is only running OSPF, then the "direct" protocol is not needed. however, i've tested this and i'm not sure it's true. without direct, and with a basic OSPF configuration with no peers, BIRD will flag the OSPF interface routes with '!': root@witch:/usr/local/etc # birdc show route BIRD 3.2.0 ready. Table master4: 81.2.96.160/28 unicast [core4 22:45:00.630] ! I (150/10) [198.18.2.4] dev genet0 Table master6: 2001:8b0:aab5:c401::/64 unicast [core6 22:45:00.630] ! I (150/10) [198.18.2.4] dev genet0 it will also log very much some netlink errors: May 31 22:51:04 witch bird[31390]: Netlink: File exists May 31 22:51:04 witch syslogd: last message repeated 1 times May 31 22:52:04 witch bird[31390]: Netlink: Address already in use May 31 22:52:04 witch bird[31390]: Netlink: File exists May 31 22:52:04 witch syslogd: last message repeated 1 times after configuring BIRD with: protocol direct { ipv4; ipv6; }; the OSPF interface routes are correctly installed (or rather, not installed, since the kernel already installed them): root@witch:/usr/local/etc # birdc show route BIRD 3.2.0 ready. Table master4: 81.2.96.160/28 unicast [direct1 22:53:29.436] * (240) dev genet0 unicast [core4 22:53:29.529] I (150/10) [198.18.2.4] dev genet0 Table master6: 2001:8b0:aab5:c401::/64 unicast [direct1 22:53:29.436] * (240) dev genet0 unicast [core6 22:53:29.529] I (150/10) [198.18.2.4] dev genet0 and BIRD does not log anymore the netlink-related errors. i tested this on FreeBSD 15.0, so possibly this is a FreeBSD-specific behaviour that isn't present on Linux; i don't have any Linux systems to test with. but, i think the documentation of the "direct" protocol could be changed to indicate that configuring it may be necessary in at least some situations.
Hello Lexi! (Explicit Cc to David) On Sun, May 31, 2026 at 10:57:54PM +0100, Lexi Winter wrote:
the BIRD documentation says for the "direct" protocol[0]:
The question is whether it is a good idea to have such device routes in BIRD routing table. OS kernel usually handles device routes for directly connected networks by itself so we don't need (and don't want) to export these routes to the kernel protocol. OSPF protocol creates device routes for its interfaces itself and BGP protocol is usually used for exporting aggregate routes. But the Direct protocol is necessary for distance-vector protocols like RIP or Babel to announce local networks.
[0] https://bird.network.cz/?get_doc&v=30&f=bird-6.html#ss6.7
This has not changed for a long time and the new versions have the same text but just for the record, we changed websites and we're still failing to setup redirects from the old one. → https://bird.nic.cz/doc/bird-3.3.0.html#direct
as i read this, it is suggesting that if BIRD is only running OSPF, then the "direct" protocol is not needed. however, i've tested this and i'm not sure it's true.
I'm quite sure it's true for both Linux and BSD.
without direct, and with a basic OSPF configuration with no peers, BIRD will flag the OSPF interface routes with '!':
root@witch:/usr/local/etc # birdc show route BIRD 3.2.0 ready. Table master4: 81.2.96.160/28 unicast [core4 22:45:00.630] ! I (150/10) [198.18.2.4] dev genet0
Table master6: 2001:8b0:aab5:c401::/64 unicast [core6 22:45:00.630] ! I (150/10) [198.18.2.4] dev genet0
it will also log very much some netlink errors:
May 31 22:51:04 witch bird[31390]: Netlink: File exists May 31 22:51:04 witch syslogd: last message repeated 1 times May 31 22:52:04 witch bird[31390]: Netlink: Address already in use May 31 22:52:04 witch bird[31390]: Netlink: File exists May 31 22:52:04 witch syslogd: last message repeated 1 times
This looks like a kernel protocol bug. If you are, by any chance, able to describe to us the interface configuration and BIRD configuration, we'd be very pleased so that we don't have to try _something_. You may send this off-list of course.
the OSPF interface routes are correctly installed (or rather, not installed, since the kernel already installed them):
root@witch:/usr/local/etc # birdc show route BIRD 3.2.0 ready. Table master4: 81.2.96.160/28 unicast [direct1 22:53:29.436] * (240) dev genet0 unicast [core4 22:53:29.529] I (150/10) [198.18.2.4] dev genet0
Table master6: 2001:8b0:aab5:c401::/64 unicast [direct1 22:53:29.436] * (240) dev genet0 unicast [core6 22:53:29.529] I (150/10) [198.18.2.4] dev genet0
This is very weird.
and BIRD does not log anymore the netlink-related errors.
This is even more weird.
i tested this on FreeBSD 15.0, so possibly this is a FreeBSD-specific behaviour that isn't present on Linux; i don't have any Linux systems to test with. but, i think the documentation of the "direct" protocol could be changed to indicate that configuring it may be necessary in at least some situations.
We'll try this on FreeBSD 15.0 and see what happens. Thank you for reporting this! -- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
hi Maria, Maria Matejka via Bird-users wrote in <ah1I94EZ8sMDSlCm@struhadlo.private.jmq.cz>:
without direct, and with a basic OSPF configuration with no peers, BIRD will flag the OSPF interface routes with '!': [...]
This looks like a kernel protocol bug. If you are, by any chance, able to describe to us the interface configuration and BIRD configuration, we'd be very pleased so that we don't have to try _something_. You may send this off-list of course.
i've attached the bird.conf. although OSPF is configured, currently there are no peers, so both OSPF instances are "Alone". the config is deliberately as simple as possible, because i wanted to find out where these netlink errors are coming from. the host's interface configuration is: # ifconfig genet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> ether d8:3a:dd:53:f7:59 inet 81.2.96.163/28 broadcast 81.2.96.175 inet6 fe80::da3a:ddff:fe53:f759%genet0/64 scopeid 0x1 inet6 2001:8b0:aab5:c401::1:3/64 media: Ethernet autoselect (1000baseT <full-duplex>) status: active nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1/8 inet6 ::1/128 inet6 fe80::1%lo0/64 scopeid 0x2 groups: lo nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> also, the routing table, in case that's helpful: # netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 81.2.96.161 UGS genet0 81.2.96.160/28 link#1 U genet0 81.2.96.163 link#2 UHS lo0 127.0.0.1 link#2 UH lo0 Internet6: Destination Gateway Flags Netif Expire ::/96 link#2 URS lo0 default 2001:8b0:aab5:c401::1 UGS genet0 ::1 link#2 UHS lo0 ::ffff:0.0.0.0/96 link#2 URS lo0 2001:8b0:aab5:c401::/64 link#1 U genet0 2001:8b0:aab5:c401::1:3 link#2 UHS lo0 fe80::%lo0/10 link#2 URS lo0 fe80::%genet0/64 link#1 U genet0 fe80::da3a:ddff:fe53:f759%lo0 link#2 UHS lo0 fe80::%lo0/64 link#2 U lo0 fe80::1%lo0 link#2 UHS lo0 ff02::/16 link#2 URS lo0
We'll try this on FreeBSD 15.0 and see what happens. Thank you for reporting this!
if you're able to reproduce the issue and it seems to be a FreeBSD kernel bug, please feel free to cc me (ivy@FreeBSD.org) on a PR or Phab review.
participants (2)
-
Lexi Winter -
Maria Matejka