BGP routes will not replace higher distance routes already in the routing table
Hey guys,
I've run into a couple different scenarios where the Fortigate will ignore an eBGP route (distance 20) and instead hold on to a higher distance router (e.g. static, or ospf) which it had learned about previously. Here is an example. My Fortigate learns about routes to 10.2.137.0/24 via both BGP & OSPF. If it learns the BGP route first, and then the OSPF, it shows both in the router database, but selects the BGP route as it is lower distance:
O 10.2.137.0/24 [110/2] via 10.4.3.178, port1, 00:02:31B *> 10.2.137.0/24 [20/0] via 10.4.3.181, Colo, 00:02:44
However, if for some reason the OSPF route is learned first, when the BGP route is learned, it never adds it to the routing database or routing table:
O *> 10.2.137.0/24 [110/2] via 10.4.3.178, port1, 00:03:36
#get router info routing-table details 10.2.137.0/24
Routing table for VRF=0 Routing entry for 10.2.137.0/24 Known via "ospf", distance 110, metric 2, best Last update 00:04:01 ago * 10.4.3.178, via port1
However it does show up in the BGP networks:
# get router info bgp network 10.2.137.0/24 BGP routing table entry for 10.2.137.0/24 Paths: (2 available, best #2, table Default-IP-Routing-Table) Advertised to non peer-group peers:10.4.3.181 65000 65000 65000 65000 65000 65000 65000 10.4.3.181 from 10.4.3.181 Origin incomplete metric 0, localpref 100, valid, external Last update: Thu Feb 6 22:42:48 2020
Local 10.4.3.178 from 0.0.0.0 Origin incomplete metric 2, localpref 100, weight 32768, valid, sourced, best Last update: Thu Feb 6 22:42:41 2020
Is this an intended behavior, and/or is there anything I can do to get the Fortigate to replace the existing (higher distance) route with a newly discovered, lower distance eBGP route?
Thanks.
