11-02-2019 09:36 PM
Have a router, learns the default route from OSPF, and learn the default route from BGP. I need to redistribute the default route from OSPF to BGP, for other routers, also from BGP to OSPF. So if the default route is gone in OSPF, this router will advertise default route into OSPF.
Now, what I found is if I use command "redistribute bgp xxx subnets" in the OSPF config, if there is no default route learn from BGP, the only default route in the BGP table is redistributed from OSPF, it will not redistribute the default back to OSPF, which is good.
R2(config-router)#do sh run | sec router
router ospf 200
router-id 2.2.2.2
log-adjacency-changes
redistribute bgp 100 subnets tag 222
R2(config-router)#do sh ip bgp 0.0.0.0/0
BGP routing table entry for 0.0.0.0/0, version 98
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1
Local
10.1.1.1 from 0.0.0.0 (2.2.2.2)
Origin incomplete, metric 1, localpref 100, weight 32768, valid, sourced, best
Community: 666:300 7777:101
R5:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 380 0x80000003 0x001D17 100
3.3.3.3 2.2.2.2 69 0x80000001 0x000EB2 222
5.0.0.0 2.2.2.2 69 0x80000002 0x005571 222
But if I used a route-map to set some tags "redistribute bgp xxx subnets route-map B-to-O" in the OSPF config, even the only default route in the BGP table is redistributed from OSPF, the router WILL redistribute the default from BGP back to OSPF :(
R2(config-router)#do sh run | sec router
router ospf 200
router-id 2.2.2.2
log-adjacency-changes
redistribute bgp 100 subnets tag 222 route-map B-to-O
R2(config-router)#do sh ip bgp 0.0.0.0/0
BGP routing table entry for 0.0.0.0/0, version 98
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1
Local
10.1.1.1 from 0.0.0.0 (2.2.2.2)
Origin incomplete, metric 1, localpref 100, weight 32768, valid, sourced, best
Community: 666:300 7777:101
R5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 552 0x80000003 0x001D17 100
0.0.0.0 2.2.2.2 83 0x80000001 0x00475F 5
3.3.3.3 2.2.2.2 83 0x80000002 0x00BADE 5
Is this a bug? how can I overcome this issue? I don't want R2 to redistribute the default route from BGP back to OSPF where it's actually redistributed from OSPF into BGP, causing a redistribution loop.
Can someone please help me?
Thanks a lot.
11-03-2019 12:56 AM
Hello,
what exactly does the route map look like ? And what does your topology look like ? Post the full configs of the relevant routers so we can lab this.
11-04-2019 02:20 AM
This is the BGP to OSPF route-map.
route-map B-to-O deny 5
match route-type local
route-map B-to-O permit 10
set tag 5
the top is simple, R2 is connecting to R1 and R5 on OSPF area 0, and R3 on BGP. R1 has a default route, injected into OSFP.
Thanks
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