<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 14px; font-family: 宋体; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hello,</div><div><br></div><div>Another workaround might be setting a metric different from system's routes in kernel protocol</div><div>to prevent system from rewriting existing routes.</div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span>Zhang Xun</span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em; margin-Right: inherit"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:bastien+bird@durel.org">Bastien Durel</a></div><div><b>Date:</b> 2021-09-29 15:35</div><div><b>To:</b> <a href="mailto:bird-users@network.cz">bird-users</a></div><div><b>Subject:</b> OSPF on OpenBSD</div></div></div><div><div>Hello,</div>
<div> </div>
<div>I'm trying to use bird to replace ospfd on OpenBSD, but it seems to</div>
<div>have a strange effect on the networking stack :(</div>
<div> </div>
<div>I've tried multiple times, from OpenBSD 6.6 to 6.9, with bird2 (2.0.8</div>
<div>now)</div>
<div> </div>
<div>Here is my bird config:</div>
<div> </div>
<div>openbsd-test# cat /etc/bird.conf|grep -v ^#|grep -v '^$' </div>
<div>log "/var/log/bird.log" { debug, trace, info, remote, warning, error,</div>
<div>auth, fatal, bug };</div>
<div>router id 10.42.42.69;</div>
<div>debug protocols all;</div>
<div>protocol device {</div>
<div>}</div>
<div>protocol direct {</div>
<div> disabled; # Disable by default</div>
<div> ipv4; # Connect to default IPv4 table</div>
<div> ipv6; # ... and to default IPv6 table</div>
<div>}</div>
<div>protocol kernel {</div>
<div> ipv4 { # Connect protocol to IPv4 table by</div>
<div>channel</div>
<div> export all; # Export to protocol. default is export</div>
<div>none</div>
<div> };</div>
<div>}</div>
<div>protocol kernel {</div>
<div> ipv6 { export all; };</div>
<div>}</div>
<div>protocol static {</div>
<div> ipv4; # Again, IPv4 channel with default</div>
<div>options</div>
<div>}</div>
<div>protocol ospf v2 ospfv2 {</div>
<div> rfc1583compat yes;</div>
<div> tick 2;</div>
<div> ipv4 {};</div>
<div> area 0 {</div>
<div> interface "em0" { cost 5; };</div>
<div> };</div>
<div>}</div>
<div> </div>
<div>And the em0 config:</div>
<div>em0:</div>
<div>flags=248843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF6TEMP,AUTOC</div>
<div>ONF6> mtu 1500</div>
<div> lladdr 08:00:27:d6:6e:dd</div>
<div> index 1 priority 0 llprio 3</div>
<div> groups: egress</div>
<div> media: Ethernet autoselect (1000baseT full-duplex)</div>
<div> status: active</div>
<div> inet6 fe80::a00:27ff:fed6:6edd%em0 prefixlen 64 scopeid 0x1</div>
<div> inet 10.42.42.69 netmask 0xffffff00 broadcast 10.42.42.255</div>
<div> </div>
<div>Before starting bird, I have a simple routing table :</div>
<div> </div>
<div>openbsd-test# route -n show -</div>
<div>inet </div>
<div> </div>
<div> </div>
<div>Routing tables</div>
<div> </div>
<div>Internet:</div>
<div>Destination Gateway Flags Refs Use Mtu Prio</div>
<div>Iface</div>
<div>default 10.42.42.1 UGS 6 12 - 8</div>
<div>em0 </div>
<div>224/4 127.0.0.1 URS 0 0 32768 8</div>
<div>lo0 </div>
<div>10.42.42/24 10.42.42.69 UCn 2 0 - 4</div>
<div>em0 </div>
<div>10.42.42.1 40:62:31:07:55:11 UHLch 1 2 - 3</div>
<div>em0 </div>
<div>10.42.42.21 00:25:22:1e:0b:b7 UHLc 0 1 - 3</div>
<div>em0 </div>
<div>10.42.42.69 08:00:27:d6:6e:dd UHLl 0 4 - 1</div>
<div>em0 </div>
<div>10.42.42.255 10.42.42.69 UHb 0 0 - 1</div>
<div>em0 </div>
<div>127/8 127.0.0.1 UGRS 0 0 32768 8</div>
<div>lo0 </div>
<div>127.0.0.1 127.0.0.1 UHhl 1 2 32768 1</div>
<div>lo0 </div>
<div> </div>
<div>When bird is started, it inserts routes as intended:</div>
<div> </div>
<div>openbsd-test# route -n show -inet </div>
<div>Routing tables</div>
<div> </div>
<div>Internet:</div>
<div>Destination Gateway Flags Refs Use Mtu Prio</div>
<div>Iface</div>
<div>default 10.42.42.1 UGS 5 314 - 8</div>
<div>em0 </div>
<div>default 10.42.42.1 UG1 0 0 - 56</div>
<div>em0 </div>
<div>224/4 127.0.0.1 URS 0 19 32768 8</div>
<div>lo0 </div>
<div>5.39.65.35 10.42.42.1 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>10.0.42.21 10.42.42.21 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>10.2.0/24 10.42.42.1 UG1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.0/24 10.42.42.1 UG1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.1.56/30 10.42.42.21 UG1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.1.64/30 10.42.42.21 UG1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.7.6 10.42.42.21 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.7.7 10.42.42.21 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.7.53 10.42.42.21 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>10.42.42/24 10.42.42.69 U1h 66 193 - 56</div>
<div>em0 </div>
<div>10.42.42.69 08:00:27:d6:6e:dd UHLl 0 104 - 1</div>
<div>em0 </div>
<div>10.42.42.255 10.42.42.69 UHb 0 13 - 1</div>
<div>em0 </div>
<div>10.60.77.5 10.42.42.1 UGH1 0 0 - 56</div>
<div>em0 </div>
<div>[...]</div>
<div> </div>
<div>But after that, the box cannot join anythin with IPv4. Established</div>
<div>connections (eg. ssh) over IPv4 fails. Even the gateway is unreachable:</div>
<div> </div>
<div>openbsd-test# ping 10.42.42.1</div>
<div>PING 10.42.42.1 (10.42.42.1): 56 data bytes</div>
<div>ping: sendmsg: Invalid argument</div>
<div>ping: wrote 10.42.42.1 64 chars, ret=-1</div>
<div>ping: sendmsg: Invalid argument</div>
<div>ping: wrote 10.42.42.1 64 chars, ret=-1</div>
<div>^C</div>
<div>--- 10.42.42.1 ping statistics ---</div>
<div>2 packets transmitted, 0 packets received, 100.0% packet loss</div>
<div> </div>
<div>With no ospfv3 configured, ipv6 connections are not lost</div>
<div> </div>
<div>dmesg returns theses messages :</div>
<div> </div>
<div>arp_rtrequest: bad gateway value: em0</div>
<div>arpresolve: 10.42.42.1: route contains no arp information</div>
<div>arpresolve: 10.42.42.0: route contains no arp information</div>
<div>arpresolve: 10.42.42.1: route contains no arp information</div>
<div> </div>
<div>The last ones beeing flooded when the box tries to send packets</div>
<div> </div>
<div>Whatever bird makes to the networking stack persists even if bird is</div>
<div>shut down. A reboot is necessary to recover.</div>
<div> </div>
<div>On OpenBSD mailing list, someone said the problem may be bird</div>
<div>overwriting the 10.42.42/24 route (which was directly connected) by</div>
<div>another (the flags changed from UCn to U1h)</div>
<div> </div>
<div>After stopping bird, flags and prios are not restored (10.42.42/24 gets</div>
<div>U1 / prio 56), and the default route kept is the one bird inserted</div>
<div> </div>
<div>openbsd-test# route -n show -inet </div>
<div>Routing tables</div>
<div> </div>
<div>Internet:</div>
<div>Destination Gateway Flags Refs Use Mtu Prio</div>
<div>Iface</div>
<div>default 10.42.42.1 UG1 2 2 - 56</div>
<div>em0 </div>
<div>224/4 127.0.0.1 URS 0 13 32768 8</div>
<div>lo0 </div>
<div>10.42.42/24 10.42.42.69 U1 0 76 - 56</div>
<div>em0 </div>
<div>10.42.42.69 08:00:27:d6:6e:dd UHLl 0 23 - 1</div>
<div>em0 </div>
<div>10.42.42.255 10.42.42.69 UHb 0 6 - 1</div>
<div>em0 </div>
<div>127/8 127.0.0.1 UGRS 0 0 32768 8</div>
<div>lo0 </div>
<div>127.0.0.1 127.0.0.1 UHhl 1 2 32768 1</div>
<div>lo0 </div>
<div> </div>
<div>Do you know how to prevent that ?</div>
<div> </div>
<div>Thanks,</div>
<div> </div>
<div> </div>
<div>-- </div>
<div>Bastien</div>
</div></blockquote>
</body></html>