Table of Contents
Problem Summary
An enterprise site experienced sporadic loss of connectivity to external services and some internal prefixes. The issue appeared after a change request to redistribute OSPF into BGP and vice versa at the WAN edge.
- Traffic destined to 10.10.20.0/24 was getting dropped
- No clear logs of interface or link failures
- Core and edge routers were showing inconsistent routing tables
Symptoms Observed
- Users intermittently lose access to cloud apps hosted behind BGP neighbors
- Routes keep flapping in routing table (
sh ip route
) - Multiple duplicate entries with different next hops in some routers
- Routing loops observed in traceroute
- Some routers have both OSPF and BGP routes for the same prefix
- Redistribution configs found on both edge and core routers
Example output:
R1# show ip route 10.10.20.0 B* 10.10.20.0/24 [20/0] via 192.0.2.1 O 10.10.20.0/24 [110/20] via 192.168.10.1
Root Cause Analysis
The team discovered that OSPF routes were redistributed into BGP at one router, and BGP routes were redistributed back into OSPF at another router without filtering.
This created a route feedback loop where:
- BGP was learning routes originally from OSPF
- Then those same BGP routes were redistributed back into OSPF
- This caused OSPF to treat them as external (E2), which were again redistributed to BGP
The loop inflated the routing tables and confused best path selection, leading to blackholes when metrics didn’t align.
Root Cause: Lack of route tagging, filtering, and redistribution control between OSPF and BGP
The Fix
Step-by-Step Solution:
- Apply Route Tags During Redistribution
To tag OSPF routes being redistributed into BGP:
route-map OSPF-TO-BGP permit 10 match ip address prefix-list OSPF-ROUTES set tag 100 router bgp 65001 redistribute ospf 1 route-map OSPF-TO-BGP
- Filter Tagged Routes from Re-entering OSPF
route-map BGP-TO-OSPF deny 10 match tag 100 route-map BGP-TO-OSPF permit 20 router ospf 1 redistribute bgp 65001 subnets route-map BGP-TO-OSPF
- Use Prefix Lists for Control
ip prefix-list OSPF-ROUTES seq 5 permit 10.10.0.0/16 le 24 ip prefix-list BGP-ROUTES seq 5 permit 192.168.0.0/16 le 24
- Clear Routes and Monitor
clear ip route * clear ip bgp *
- Verify Consistent Route Origins
Useshow ip route
andshow ip bgp
to confirm the route source.
EVE-NG Lab Topology

- R1 redistributes OSPF to BGP
- R2 redistributes BGP to OSPF without filtering
- R3 receives duplicate/conflicting routes
Lab goal: reproduce route loop → apply tagging/filtering → verify fix
Verification
Use These Commands:
show ip route <prefix> show ip bgp <prefix> show ip ospf database external show ip protocols debug ip routing debug ip bgp updates
Expected Results After Fix:
- No duplicate routes in routing table
- Route tags visible in OSPF LSAs
- Traceroute follows expected path
- Application access restored
Key Takeaways
- Blind two-way redistribution between BGP and OSPF is dangerous
- Always use route tags and filtering to prevent loops
- OSPF external routes (E2/N2) don’t always calculate cost properly in loops
- Redistributing the same prefix back and forth can cause blackholes
- Use prefix-lists, tags, and route-maps as your main tools for control
Best Practices / Design Tips
- Avoid two-way redistribution unless absolutely necessary
- Use route tagging to track redistribution origin
- Filter outbound redistributed routes based on tag
- Use different tags for each protocol to avoid overlap
- Prefer iBGP over route redistribution where possible
- Monitor LSAs and BGP updates frequently
- Use route-maps with sequence numbers for clean logic
- Document redistribution rules per site/peer
- Use route summarization to limit excessive routes
- Avoid redistributing default routes blindly
- Always lab-test redistribution scenarios before production
- Enable logging for routing protocol changes
- Prefer backdoor routes for critical links to avoid redistributed paths
- Track metric types (E1 vs E2) to understand route preference
- Use named prefix-lists and structured config templates
FAQs
1. What causes route redistribution loops?
Answer: When two protocols (like OSPF and BGP) redistribute into each other without filtering or tagging, the same routes can circulate repeatedly, causing loops and blackholes.
2. How do I know if my routing table has a loop?
Answer: If you see the same prefix with different sources (OSPF and BGP), frequent route flapping, or inconsistent next hops — it may indicate a loop.
3. What is route tagging in redistribution?
Answer: It marks routes with a numerical tag when redistributing. These tags can later be matched and filtered to prevent the same route from re-entering the protocol.
4. Can you redistribute OSPF into BGP safely?
Answer: Yes, but only with strict filtering and tagging. Otherwise, it can lead to routing feedback loops.
5. Why is prefix-list better than access-list for route control?
Answer: Prefix-lists are designed for route filtering and support granular control with masks, whereas access-lists are more for packet filtering.
6. What does “subnets” mean in redistribution commands?
Answer: It allows redistribution of subnets smaller than the classful boundary. Without subnets
, only classful routes are redistributed.
7. Is it okay to redistribute full BGP table into OSPF?
Answer: No. This is dangerous and will overwhelm OSPF. Only redistribute required prefixes.
8. What are E2 routes in OSPF?
Answer: E2 routes are external routes with a fixed metric. They don’t consider internal OSPF cost, which can lead to suboptimal routing in redistribution loops.
9. What’s the default administrative distance for OSPF and BGP?
Answer: OSPF: 110 (intra-area), External: 110–150
BGP: iBGP 200, eBGP 20
10. Can redistribution impact convergence time?
Answer: Yes. Excessive or incorrect redistribution increases route churn and convergence delays.
11. What command helps confirm redistributed routes?
show ip route <prefix> show ip ospf database external show ip bgp <prefix>
12. How to test redistribution in a lab?
Answer: Use EVE-NG or GNS3, simulate dual-protocol routers, redistribute with/without tags, and observe the results.
13. What is a good default redistribution model?
Answer: OSPF → BGP with tags
BGP → OSPF with route-map that filters tagged routes
14. Can you use match metric
in route-maps?
Answer: Yes, but match tag
is more appropriate for controlling redistributed routes.
15. Is there a way to visualize loops?
Answer: Yes. Tools like NetBrain, traceroute, or topology mapping in EVE-NG can help identify routing loops graphically.
YouTube Link
Watch the Complete CCNP Enterprise: Routing Table Blackhole – Route Redistribution Loop Detected Between OSPF and BGP Lab Demo & Explanation on our channel:
Final Note
Understanding how to differentiate and implement Routing Table Blackhole – Route Redistribution Loop Detected Between OSPF and BGP is critical for anyone pursuing CCNP Enterprise (ENCOR) certification or working in enterprise network roles. Use this guide in your practice labs, real-world projects, and interviews to show a solid grasp of architectural planning and CLI-level configuration skills.
If you found this article helpful and want to take your skills to the next level, I invite you to join my Instructor-Led Weekend Batch for:
CCNP Enterprise to CCIE Enterprise – Covering ENCOR, ENARSI, SD-WAN, and more!
Get hands-on labs, real-world projects, and industry-grade training that strengthens your Routing & Switching foundations while preparing you for advanced certifications and job roles.
Email: info@networkjourney.com
WhatsApp / Call: +91 97395 21088
Upskill now and future-proof your networking career!