09-10-2025 03:45 AM
Hi Folks,
Hope all are doing good.
I need your support on one case where we are having eBGP between upstream ISP to my core router and inside my networks multiple routers are connected with my Core Routers and Running OSPF internally.
Done redistribution of OSPF to BGP and BGP to OSPF on both core routers(R2 and R5) in attached topology. As per my understanding loop will be created, but I am able to reach towards PC from R8 or any other Router.
Can someone help to understand, why loop is not creating even after redistribution of protocols with each other.
Solved! Go to Solution.
09-10-2025 05:19 AM
Hello @inderjeet452 ,
issues can arise when a topology change happens. If for example you shut down one interface in one OSPF router.
For real world scenarios involving OSPF and BGP you can avoid mutual redistribution in multiple points by using network commands in BGP to advertise OSPF learned prefixes in BGP. Eventually combined with aggregate commands in BGP.
If mutual redistribution is needed appropriate route tagging or BGP community settings can be used to avoid re-injection of OSPF route from BGP in OSPF and vice versa
Route-maps need to be used with a first block with deny action like
route-map BGP-into-OSPF deny 10
match route-tag 179
route-map BGP-into-OSPF permit 10
set route tag 179
Hope to help
Giuseppe
09-11-2025 12:56 AM - edited 09-11-2025 01:01 AM
Forget incomplete, origin selection come after as-path length.
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html
As I mentioned ibgp must win because it have shortest as-path
Do show ip bgp and check this point
MHM
09-11-2025 01:15 AM
Hello
When performing mutual redistribution at dual redistribution points, you could indeed incur loops in the network.
As stated by others using route tags to permit and deny is a good way of negating such issues specifically between two differing IGPs, but when you have and BGP/IGP redistribution I would say a good way would to incorporate BOTH route tags and BGP attributes.
This would mean setting route-tags to BGP redistributed routes into OSPF and Community attributes to redistributed OSPF routes into BGP.
Example:
bgp - 179
ospf- 89
ip bgp-community new-format
ip community-list standard OSPF-TAG permit 100:89
route-map bgp-ospf deny 10
match community OSPF-TAG
route-map bgp-ospf permit 100
set tag 179
route-map ospf-bgp deny 10
match tag 179
route-map ospf-bgp permit 100
set community 100:89
router bgp xx
redsitribtue ospf route-map ospf-bgp
router ospf
redsitribtue bgp route-map bgp-ospf subnets
09-11-2025 02:30 AM
At last as I understood, as per @MHM Cisco World , iBGP path will win as it is having shortest AS Path and Downward on R8, it will be having multiple Paths to reach 192.168.0.0 subnet, where OSPF will win.
Thanks @paul driver @srimal99 @Giuseppe Larosa @David Ruess Everyone for your valuable comments and guidance....!!!
That was a great discussion....!!!
09-10-2025 04:11 AM
Hello @inderjeet452
Redistribution alone does not always create forwarding loop because protocol protection (AD, AS-PATh), attributes, and likely taging/selection rules are preventing re-install of the same route in a way that would loop traffic — but, advice, you should still harden redistribution with tags and filters to be safe. Control the redistribution, think route-map in ingress and egress.
09-10-2025 04:51 AM - edited 09-10-2025 04:51 AM
Agree with taging option there, but when we doing redistribution, ORIGIN is getting removed and will get "?" there. If Origin is not known, on which parameters it prevent loop.
09-10-2025 04:32 AM
Hello,
In agreement with M02@rt37 that mutual redistribution by itself likely wont cause a loop. Routing protocols are pretty robust in being able to prevent looks (unless you manually intervene with other metrics or static routes). Also as M02@rt37 said you can tag routes as they are being redistributed into your network and not be allowed back out another direction.
You should be ok with your current setup.
-David
09-10-2025 04:43 AM
Redistrubte two points sure make loop
Ospf 90/110 ebgp is 20
But that other issue
For ping do you use source IP of ping ?
MHM
09-10-2025 05:18 AM
Source loopback IP have taken...Without source also tried
09-10-2025 04:49 AM
I have seen in R2 and R5, getting PC prefix learned with tag 9829(Origin ASN), same is getting on other Routers as well via Redistribute into OSPF.
Can anyone please confirm in deep, why loop is not creating while it is in Area 1 and redistribution done on BGP and OSPF on R2 and R5. I haven't given any tag there till now and redistributed E1,E2 and Internal ospf routes into BGP. It should create loop but still didn't get why loop is not forming here.
09-10-2025 04:56 AM
Can I see R1 and R9 and R8 config
MHM
09-10-2025 05:20 AM
09-10-2025 05:37 AM
I need config as text
MHM
09-10-2025 05:48 AM
09-10-2025 05:56 AM
And R2 and R5
MHM
09-10-2025 06:05 AM - edited 09-10-2025 06:45 AM
Let me make double check
MHM
09-10-2025 06:42 AM
09-10-2025 06:56 AM
the R9 must have two path
can I see
show ip bgp 192.168.0.0 in R9
MHM
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