03-25-2020 04:08 AM
Hi, all,
i got an issue in a fail over design, in my topology, the WAN router is redistributing the routes from OSPF into BGP network, however the WAN router also can receive the same routes, like 10.10.10.0/24 from its' EBGP Peer. And we have the policy to redistribute the same route back to OSPF from BGP. By default, the best route for this route is redistributed from OSPF to BGP with highest weight. Once the 10.10.10.0/24 was removed from OSPF. the Wan router will automatically just redistribute this route from BGP to OSPF and the show ip bgp display the best route from EBGP peer.
The problem is when I add the route into ospf again, the show ip bgp remains the best route from EBGP peer and no redistribution happen from OSPF to BGP. Seems it's not automatically refresh the routing table. And then, I use "clear ip bgp * to refresh the bgp routing table. now the redistribution happens and the best route become the redistributed one again.Is there any way to make BGP to automatically refresh its' routing table in this case? Thanks a lot.
Solved! Go to Solution.
03-25-2020 05:31 AM
Hi,
It's an order of operation issue, what's seeing is normal and it's a RIB decision based on the AD.
1. The router receives the 10.10.10.0/24 via OSPF, OSPF selects its best path for this prefix and sends it to the RIB, where it gets installed with an AD of 110, as so far only OSPF notifies the RIB about a best path for this prefix. When you redistribute OSFP into BGP, it takes all its RIB installed routes and puts it into BGP table (this gets redistributed with a high weight), next BGP receive the same prefix from its EBGP neighbor, and now BGP has to make a call on its best-path for the prefix, the one received from EBGP or the one local redistributed, and it stops at first step, highest weight, thus the locally redistributed route wins to be the best path from BGP perspective for that prefix; and so BGP does not send its best path to the RIB as it came from the RIB, via redistribution.
2. The OSPF route i gone, for whatever reason, and OSPF no longer has a best path for 10.10.10.0/24. Now BGP recomputes its best path for that prefix, which is via its EBGP neighbour and sends it to the RIB, and because the RIB receives information for that prefix only from BGP, it becomes best and installed in the RIB with AD of 20. When the OSPF starts advertising again the prefix, OSPF also sends its now computed best path to the RIB, but the RIB prefers the BGP path because of the lower AD, thus the OSPF path never makes it to the RIB, does it never get redistributed again into BGP.
You have 2 solutions:
1. configure the OSPF AD for the prefix (and any other prefixes facing the same scenario) to be lower than 20, like 19
2. configure the EBGP AD for that prefix (and any other prefixes facing the same scenario) to be higher than 110, like 111
This way, regardless of which protocol comes up first (OSPF or BGP), or which one goes down and comes back up, when the prefix is learned via both routing protocols, the OSFP path will always be preferred by the RIB, and as a result of this, the OSPF prefix also gets redistributed into BGP, which selects the locally redistributed prefix as best and it advertises it to its EBGP neighbor.
Regards,
Cristian Matei.
03-25-2020 05:36 AM
This is by design. EBGP admin distance is 20 while OSPF's is 110. So EBGP learned route is better and that's what is active. You will need to decrease ospf admin distance to 19 if you want it to be preferred over ebgp. Alternatively, you can increase eBGP to > 110 as described below:
https://www.cisco.com/c/en/us/support/docs/ip/ip-routed-protocols/113153-adjust-ad-00.html
HTH.
03-25-2020 05:31 AM
Hi,
It's an order of operation issue, what's seeing is normal and it's a RIB decision based on the AD.
1. The router receives the 10.10.10.0/24 via OSPF, OSPF selects its best path for this prefix and sends it to the RIB, where it gets installed with an AD of 110, as so far only OSPF notifies the RIB about a best path for this prefix. When you redistribute OSFP into BGP, it takes all its RIB installed routes and puts it into BGP table (this gets redistributed with a high weight), next BGP receive the same prefix from its EBGP neighbor, and now BGP has to make a call on its best-path for the prefix, the one received from EBGP or the one local redistributed, and it stops at first step, highest weight, thus the locally redistributed route wins to be the best path from BGP perspective for that prefix; and so BGP does not send its best path to the RIB as it came from the RIB, via redistribution.
2. The OSPF route i gone, for whatever reason, and OSPF no longer has a best path for 10.10.10.0/24. Now BGP recomputes its best path for that prefix, which is via its EBGP neighbour and sends it to the RIB, and because the RIB receives information for that prefix only from BGP, it becomes best and installed in the RIB with AD of 20. When the OSPF starts advertising again the prefix, OSPF also sends its now computed best path to the RIB, but the RIB prefers the BGP path because of the lower AD, thus the OSPF path never makes it to the RIB, does it never get redistributed again into BGP.
You have 2 solutions:
1. configure the OSPF AD for the prefix (and any other prefixes facing the same scenario) to be lower than 20, like 19
2. configure the EBGP AD for that prefix (and any other prefixes facing the same scenario) to be higher than 110, like 111
This way, regardless of which protocol comes up first (OSPF or BGP), or which one goes down and comes back up, when the prefix is learned via both routing protocols, the OSFP path will always be preferred by the RIB, and as a result of this, the OSPF prefix also gets redistributed into BGP, which selects the locally redistributed prefix as best and it advertises it to its EBGP neighbor.
Regards,
Cristian Matei.
03-25-2020 07:45 AM
Thank you so much indeed~~~ understand now
03-25-2020 05:36 AM
This is by design. EBGP admin distance is 20 while OSPF's is 110. So EBGP learned route is better and that's what is active. You will need to decrease ospf admin distance to 19 if you want it to be preferred over ebgp. Alternatively, you can increase eBGP to > 110 as described below:
https://www.cisco.com/c/en/us/support/docs/ip/ip-routed-protocols/113153-adjust-ad-00.html
HTH.
03-25-2020 07:46 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide