OpenOSPFd replacing network routes

Gary Gatten Ggatten at
Fri Aug 19 23:32:36 UTC 2011

I don't have any experience with *BSD and OSPF, only on Cisco.  But I can't help but wonder if there are not knobs to tune this?  Equal costs routes are pretty common, and although I have not read the RFC on OSPF, I'd be surprised if ECR are not mandatory.

----- Original Message -----
From: Danny Srepel [mailto:dsrepel at]
Sent: Friday, August 19, 2011 06:13 PM
To: 'freebsd-questions at' <freebsd-questions at>
Subject: OpenOSPFd replacing network routes

There's a fundamental difference between OpenBSD and FreeBSD's respective networking. Specifically, the kernel routing table. In OpenBSD, it is possible to have multiple routes to the same destination, and are differentiated by priority. This capability does not exist in FreeBSD.

Let me just get right into the details by outlining a functioning OpenBSD system, and where FreeBSD's issues are.

This is my example ospfd.conf,

01| router-id
02| redistribute connected
03| redistribute static
04| area {
05|         interface vlan1
06| }

Below is output from `netstat -rn' taken form an OpenBSD machine before the OpenOSPFd process was started. The network is used to exchange OSPF information with its neighbours. is a connected network to this host. is one hop away (via, its only neighbour).

07| Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
08| 127/8              UGRS       0        0 33160     8 lo0
09|          UH         1        0 33160     4 lo0
10| 192.168.11/24      link#5             UC         0        0     -     4 vlan1
11| 192.168.12/24      link#6             UC         0        0     -     4 vlan2
12| 224/4              URS        0        0 33160     8 lo0

And this is `netstat -rn' taken after OpenOSPFd finished negotiating with its neighbour,

13| Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
14| 127/8              UGRS       0        0 33160     8 lo0
15|          UH         1        0 33160     4 lo0
16| 192.168.11/24      link#5             UC         2        0     -     4 vlan1
17| 192.168.11/24       UG         0        0     -    32 vlan1
18|       00:50:56:96:00:89  UHLc       1        0     -     4 lo0
19|       00:50:56:96:00:90  UHLc       2        7     -     4 vlan1
20| 192.168.12/24      link#6             UC         0        0     -     4 vlan2
21| 192.168.13/24       UG         0        0     -    32 vlan1
22| 224/4              URS        0        0 33160     8 lo0

Notice there are multiple entries for (line #16-17). Line #17 was added by ospfd.

Before continuing, I'm going to paste the equivalent information on FreeBSD's side, so that we can better compare. Below is `netstat -rn' taken before ospfd is started,

23| Destination        Gateway            Flags    Refs      Use  Netif Expire
24|          link#3             UH          0      139    lo0
25|    link#1             U           0        0    em0
26|       link#1             UHS         0        0    lo0
27|    link#9             U           0        0 em0_vl
28|       link#9             UHS         0        0    lo0

And this is `netstat -rn' taken after OpenOSPFd finished negotiating with its neighbour,

29| Destination        Gateway            Flags    Refs      Use  Netif Expire
30|          link#3             UH          0      147    lo0
31|        U           1        6    em0
32|       link#1             UHS         0        0    lo0
33|    link#9             U           0        0 em0_vl
34|       link#9             UHS         0        0    lo0
35|        UG          0        0    em0
36|        UG          0        0    em0

Notice there's only one entry for (line #25 got replaced with line #31).

And that's really the cruft of the issue: in FreeBSD you can only have the one network route, whereas in OpenBSD, you can have multiple. When a neighbour goes away in FreeBSD, the route gets deleted. In OpenBSD, there's no negative impact, since there are multiple routes to the same network. Using our example, line #10 still exists as line #16 in OpenBSD, line #25 gets deleted and line #31 gets created in FreeBSD.

This isn't really a bug, it's more a difference in capabilities between FreeBSD's and OpenBSD's respective networking. OpenOSPFd doesn't seem to have any special considerations for FreeBSD.

The Fix / Workaround

The concept is simple: create an IP alias where the network overlaps the existing IP/network.
In our example, is used to exchange OSPF information. Create an alias of That way when the route gets deleted, the systems will be accessible to each other over the route. In order for this to work as expected, you'll need to make a couple changes to your ospfd.conf file.

This is the original ospfd.conf file taken from the FreeBSD system,

37| router-id
38| redistribute connected
39| redistribute static
40| area {
41|         interface em0
42| }

And this is what it looks like after adding the IP alias,

43| router-id
44| no redistribute
45| redistribute connected
46| redistribute static
47| area {
48|         interface em0:
49| }

The `no distribute' is critical.

Could people share their comments and experiences with OpenOSPFd on FreeBSD?

freebsd-questions at mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

<font size="1">
<div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in'>
"This email is intended to be reviewed by only the intended recipient
 and may contain information that is privileged and/or confidential.
 If you are not the intended recipient, you are hereby notified that
 any review, use, dissemination, disclosure or copying of this email
 and its attachments, if any, is strictly prohibited.  If you have
 received this email in error, please immediately notify the sender by
 return email and delete this email from your system."

More information about the freebsd-questions mailing list