How to make OSPF routes not more important than "connected routes"
Lukas Haase
lukashaase at gmx.at
Sat Nov 13 08:03:52 CET 2021
Hello,
This is probably fairly trivial but how can I tell bird (or Linux) that "connected routes" should have higher precedence than the routes from OSPF (even if they may be more specific)?
I have the following issue: I have a bunch of connected routers, connected via /31 links. There is also a loop.
Now a Mikrotik OSPF node sends me a route (that it can reach) for a station that's actually directly connected. Unfortunately the system takes the OSPF route. But of course, the directly connected interface route should always be preferred.
Example:
# birdc show ospf neigh
BIRD 1.6.8 ready.
edge1:
Router ID Pri State DTime Interface Router IP
203.0.113.193 1 Full/PtP 00:36 gre1 203.0.113.255
203.0.113.194 1 Full/PtP 00:37 wg1 203.0.113.225
# birdc show route | grep '203.0.113.22\(4\|5\)'
203.0.113.224/32 dev wg1 [edge1 2021-11-12] * I (150/0) [192.168.164.183]
203.0.113.225/32 via 203.0.113.255 on gre1 [edge1 06:18:20] * I (150/110) [203.0.113.194]
# ip route list | grep '203.0.113.22\(4\|5\)'
203.0.113.224/31 dev wg1 proto kernel scope link src 203.0.113.224
203.0.113.225 via 203.0.113.255 dev gre1 proto bird
Here we can see that to reach 203.0.113.225 (my desired endpoint), there are two routes: 203.0.113.224/31 which is the "connected route" set up automatically by Linux when I create the interface.
And "203.0.113.225 via 203.0.113.255" which I receive via OSPF from a Mikrotik router which can also see this node.
Even if the OSPF one is more specific, of course, I want the local connected route to have preference.
Thanks!
More information about the Bird-users
mailing list