03-08-2011 01:14 PM - edited 03-04-2019 11:41 AM
I had BGP to advertise routes using BGP network statements, with masks and static routes to null0.
The routes were learned from its adjacent OSPF neighbor.
All was good and I could see these routes in bgp RIB as expected.
Now I wanted to remove the network statements and use route redistribution from OSPF instead. What I noticed was that when I removed the network statements, the routes still being advertised as nothing were removed. 'show ip bgp' showed exactly the same routes as before the removal.
It seemed that the only thing to clear these routes in bgp RIB was to remove all those static routes to null0.
Any insights or comments for this behaviour would be appreciated.
Here are the configuration and show commands with the network statements already removed. The hardware is a 3750ME running 'i5k91-mz.122-46.SE' IOS release.
router ospf 301 vrf v121:testvrf
log-adjacency-changes
capability vrf-lite
redistribute bgp 65076 metric 1000 subnets tag 2665 route-map BGP-to-OSPF-ocb
network 205.192.44.234 0.0.0.0 area 0
default-information originate
router bgp 65076
no synchronization
bgp router-id 167.54.4.95
bgp log-neighbor-changes
bgp graceful-restart restart-time 120
bgp graceful-restart stalepath-time 360
bgp graceful-restart
no auto-summary
!
address-family ipv4 vrf v121:testvrf
redistribute ospf 301 vrf v121:testvrf
neighbor 167.54.67.185 remote-as 2665
neighbor 167.54.67.185 ttl-security hops 1
neighbor 167.54.67.185 transport path-mtu-discovery
neighbor 167.54.67.185 password abc123
neighbor 167.54.67.185 activate
neighbor 167.54.67.185 send-community
no synchronization
exit-address-family
!
ip classless
ip route vrf v121:testvrf 142.212.104.32 255.255.255.224 Null0 250
ip route vrf v121:testvrf 142.212.104.96 255.255.255.224 Null0 250
ip route vrf v121:testvrf 142.212.104.160 255.255.255.224 Null0 250
ip route vrf v121:testvrf 142.212.104.224 255.255.255.224 Null0 250
ip route vrf v121:testvrf 142.212.107.0 255.255.255.0 Null0 250
ip prefix-list NCA_INTERNAL seq 5 permit 167.54.0.0/16 le 32
route-map BGP-to-OSPF-ocb deny 20
match ip address prefix-list NCA_INTERNAL
!
route-map BGP-to-OSPF-ocb permit 30
!
route-map OSPF-to-BGP-ocb deny 5
match tag 2665
!
route-map OSPF-to-BGP-ocb permit 10
set origin igp
lab.tel1.mvrfce1#show ip route vrf v121:testvrf
Routing Table: v121:testvrf
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
142.212.0.0/16 is variably subnetted, 11 subnets, 3 masks
S 142.212.104.32/27 is directly connected, Null0
O 142.212.104.33/32 [110/2] via 205.192.44.233, 03:42:54, Vlan301
O 142.212.107.1/32 [110/2] via 205.192.44.233, 03:42:54, Vlan301
S 142.212.107.0/24 is directly connected, Null0
O 142.212.100.1/32 [110/2] via 205.192.44.233, 03:42:54, Vlan301
S 142.212.104.96/27 is directly connected, Null0
O 142.212.104.97/32 [110/2] via 205.192.44.233, 03:42:54, Vlan301
S 142.212.104.160/27 is directly connected, Null0
O 142.212.104.161/32 [110/2] via 205.192.44.233, 03:42:54, Vlan301
S 142.212.104.224/27 is directly connected, Null0
O 142.212.104.225/32 [110/2] via 205.192.44.233, 03:42:55, Vlan301
167.54.0.0/16 is variably subnetted, 3 subnets, 2 masks
B 167.54.254.100/32 [20/0] via 167.54.67.185, 02:42:36
B 167.54.254.99/32 [20/0] via 167.54.67.185, 02:42:36
C 167.54.67.184/30 is directly connected, Vlan201
205.192.44.0/30 is subnetted, 1 subnets
C 205.192.44.232 is directly connected, Vlan301
lab.tel1.mvrfce1#show ip bgp vpnv4 vrf v121:testvrf
BGP table version is 63, local router ID is 167.54.4.95
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 2665:5104 (default for vrf v121:testvrf)
*> 142.212.104.32/27
0.0.0.0 0 32768 i
*> 142.212.104.96/27
0.0.0.0 0 32768 i
*> 142.212.104.160/27
0.0.0.0 0 32768 i
*> 142.212.104.224/27
0.0.0.0 0 32768 i
*> 142.212.107.0/24 0.0.0.0 0 32768 i
r> 167.54.67.184/30 167.54.67.185 0 0 2665 i
*> 167.54.254.99/32 167.54.67.185 0 2665 ?
*> 167.54.254.100/32
167.54.67.185 0 2665 ?
*> 205.192.44.232/30
0.0.0.0 0 32768 i
03-09-2011 09:48 AM
HI,
You need to wait for the next BGP scanner before those changes take effect. BGP scanner runs every 60s.
HTH
Laurent.
03-09-2011 09:56 AM
Hi Laurent,
I don't think this is the case of BGP scanner delay. This behaviour was observed over a long period of time, more than a day. As mentioned, I can get the bgp routes clear up instantly once I removed the static routes to null0.
03-09-2011 09:59 AM
Hi Danny,
In this case try to reproduce it and if you can, open a SR so the TAC can have a look at it.
Thanks,
Laurent.
03-09-2011 10:02 AM
Thanks Laurent.
I will search the bug tool kit first then opend a TAC case.
Have a great day.
Danny,
03-10-2011 08:56 AM
Hi,
How about clearing the bgp or routing table after the removal?
Is it possible to run bgp debug in a maintenance window to see how it behaves?
Sent from Cisco Technical Support iPhone App
03-11-2011 08:25 AM
Hi,
I tried both of the below commands, no changed.
clear ip bgp ipv4 unicast 2665
clear ip bgp vrf v121:testvrf 2665
Thanks
DTo.
03-12-2011 07:05 AM
Hi Danny,
Ok, looks like BGP table is not updating when you remove the "network" statement. Since it’s a lab setup, you can perform the debug steps to nail down the issue.
You can perform the debug for static routes as well as OSPF prefixes. This will eliminate whether BGP update having problem only for static routes or other protocols as well.
For static route:
logging buffered 5000000
logging buffered 7
service timestamps debug datetime localtime msec
service timestamps log datetime localtime msec
Enable BGP debug - debug bgp all updates (depends on the platform), debug bgp all events
Enable Static route debug - debug ip routing static detail
Add the static route
Add "network:" statements in BGP
Check what is happening (until this point, it will be good as per your observation)
Remove "network" statements
Check for any updates happening in the BGP
Clear routing table "clear ip route vrf "NAME" *)
Check for any update happening in the BGP
Remove static route
Check for any updates happening in the BGP
For OSPF prefixes
Enable BGP debug - debug bgp all updates (depends on the platform), debug bgp all events
Add a OSPF prefix in BGP and advertise
Add "network:" statements in BGP
Check what is happening (until this point, it will be good as per your observation)
Remove "network" statements
Check for any updates happening in the BGP
Clear routing table "clear ip route vrf "NAME" *)
Check for any updates happening in the BGP
BTW, what platform and IOS you are using ?
03-14-2011 08:02 AM
Hi Meenakshi,
I am using ME-3750 running 'i5k91-mz.122-46.SE' IOS release.
I will try the debug that you suggested.
Thanks
03-14-2011 12:40 PM
03-18-2011 11:15 AM
I now have a TAC case opened for this.
No further postings needed.
Thanks for all the responses.
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