Prevent duplicate routes with OSPF
Hi list, This is probably a question that was answered many times before: how can I prevent duplicate routes originating from OSPF? For example, a routing table with BIRD2 shut down:
# ip r s default via 192.168.255.1 dev eth0 192.168.255.0/24 dev eth0 proto kernel scope link src 192.168.255.82
And... with BIRD2 running:
# ip r s default via 192.168.255.1 dev eth0 1.2.3.4 dev dummy0 proto bird scope link metric 32 1.2.3.7 via 192.168.255.213 dev eth0 proto bird metric 32 192.168.255.0/24 dev eth0 proto kernel scope link src 192.168.255.82 192.168.255.0/24 dev eth0 proto bird scope link metric 32
In this example at least 192.168.255.0/24 is a duplicate. Configuration used:
log syslog all; protocol device { }
protocol direct { disabled; # Disable by default ipv4; # Connect to default IPv4 table ipv6; # ... and to default IPv6 table }
protocol kernel { ipv4 { # Connect protocol to IPv4 table by channel export all; # Export to protocol. default is export none }; }
protocol kernel { ipv6 { # Connect protocol to IPv4 table by channel export all; # Export to protocol. default is export none }; }
protocol static { ipv4; # Again, IPv4 channel with default options }
protocol static { ipv6; }
protocol ospf v2 foobar { area 0.0.0.0 { interface "dummy0" { stub; }; interface "eth0" { }; }; }
How can I prevent direct connected routes from showing up from OSPF as well ending up in duplicates? Thanks in advance! Regards, Kees -- https://nefos.nl/contact Nefos IT bv Ambachtsweg 25 (industrienummer 4217) 5627 BZ Eindhoven Nederland KvK 66494931 /Aanwezig op maandag, dinsdag, woensdag en vrijdag/
Hello, The duplicate routes can most likely be filtered by ignoring routes with 'source = RTS_DEVICE', for example:
protocol kernel {
ipv4 {
export filter {
if source = RTS_DEVICE then {
reject;
}
accept;
};
}
}
The same would be needed for ipv6. These "duplicate" routes are generated by the direct protocol for every network attached to a device. Naturally bird will export these routes, however they aren't needed in your case, since linux will generate these routes.
How can I prevent direct connected routes from showing up from OSPF as well ending up in duplicates? If you also don't want these routes in OSPF you might want to actually remove the direct protocol.
Hi there, Thank you very much. I was under the impression the routes were OSPF generated but it makes a lot of sense RTS_DEVICE is the culprit. I'll give it a try. Enjoy your day! Regards, Kees On 19-06-2019 21:46, bauen1 wrote:
The duplicate routes can most likely be filtered by ignoring routes with 'source = RTS_DEVICE', for example:
participants (2)
-
bauen1 -
Kees Meijs