cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3171
Views
0
Helpful
10
Replies

Remove bgp network statement did not remove the corresponding bgp adverstised routes

Danny To
Level 1
Level 1

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

10 Replies 10

Laurent Aubert
Cisco Employee
Cisco Employee

HI,

You need to wait for the next BGP scanner before those changes take effect. BGP scanner runs every 60s.

HTH

Laurent.

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.

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.

Thanks Laurent.

I will search the bug tool kit first then opend a TAC case.

Have a great day.

Danny,

meperuma
Level 1
Level 1

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

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.

meperuma
Level 1
Level 1

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 ?

Hi Meenakshi,

I am using ME-3750 running 'i5k91-mz.122-46.SE' IOS release.

I will try the debug that you suggested.

Thanks

See the attached .txt file for the log and show displays of the debug commands as suggested.

Thanks

Danny.

Danny To
Level 1
Level 1

I now have a TAC case opened for this.

No further postings needed.

Thanks for all the responses.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card