Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

BGP route withdrawl and clearing sessions

I wish to remove one of my subnets from being advertised from my AS on my mesh of iBGP peers. After performing a "no network x.x.x.x" statement, must I then issue a "clear ip bgp * " command ? I understand that this command will reset the BGP sessions with each peer, causing all external routes from other ASs to be removed from our routing tables for up to a few minutes - thus causing loss of connectivity between our AS and the rest of the ASs. Since it is our intention to only prevent a route from being advertised outbound to our eBGP peers, I feel that the "clear ip bgp *" command could be unnecessarily disruptive.

4 REPLIES

Re: BGP route withdrawl and clearing sessions

No you don't need to enter 'clear ip bgp' after you remove a route. BGP will send an Update message to it's peers - contains the withdrawn routes in the update.

It will look something like below (if you turned debugging on), notice it tells its peers the route is unreachable (ie withdraws the route) :

00:03:59: BGP: scanning routing tables

00:03:59: BGP: nettable_scan: invalidate local path for 10.20.20.0/24

00:03:59: BGP: nettable_scan: invalidate sourced path for 10.20.20.0/24

00:03:59: BGP: no valid path for 10.20.20.0/24

00:04:00: BGP: nettable_walker 10.20.20.0/24 no best path

00:04:00: BGP: 10.10.10.11 computing updates, neighbor version 3, table version 4, starting at 0.0.0.0

00:04:00: BGP: 10.10.10.11 send UPDATE 10.20.20.0/24 -- unreachable

00:04:00: BGP: 10.10.10.11 1 updates enqueued ip (average=27, maximum=27)

00:04:00: BGP: 10.10.10.11 update run completed, ran for 8ms, neighbor version 3, start version 4, throttled to 4, check point net 0.0.0.0

Then if you added the route back it would send an update again containing the new route informing it's peers about the new route (ie it advertises the new route):

00:07:00: BGP: scanning routing tables

00:07:00: BGP: nettable_walker 10.20.20.0/24 route sourced locally

00:07:00: BGP: 10.10.10.11 computing updates, neighbor version 4, table version 5, starting at 0.0.0.0

00:07:00: BGP: 10.10.10.11 send UPDATE 10.20.20.0/24, next 10.10.10.10, metric 0, path 1

00:07:00: BGP: 10.10.10.11 1 updates enqueued (average=52, maximum=52)

00:07:00: BGP: 10.10.10.11 update run completed, ran for 8ms, neighbor version 4, start version 5, throttled to 5, check point net 0.0.0.0

You may notice the version listed above (first one is 4 when the update is sent to remove the route, second is 5 when the route is added and the update sent), it will relate to the tblver (table version) in the 'sh ip bg sum' command.

Hope it helps.

Steve

Community Member

Re: BGP route withdrawl and clearing sessions

Steve

I hope you don't think I am trying to disagree with you. Cisco Press book on CCNP routing that I am studying states that it is necessary to reset TCP sessions between nieghbors after configuration changes in BGP4 with following command:

clear ip bgp * | address soft in | out

Says that the soft option will not tear down the sessions but it resends the updates. The in and out options allow the configuration of inbound and outbound soft updates and that the default is for both.

From what I see in your post, this command is not necessary in this case. Could you let us know in what situations, when configuration changes are being made, that this command would be needed? Thanks

Re: BGP route withdrawl and clearing sessions

When a network is added or removed, BGP will automatically send an Update message informing it's peers about the change. Just like any other routing protocol. If BGP required a manual intervention, there would be way too much outdated info/black holes in routing tables.

The command 'clear ip bgp' is needed only when you have changed the BGP policy (eg route-map/MED/Local/pref/weight/community/etc.) It is a total reset, which resets the peer state to IDLE and then restarts the peering process.

The command 'clear ip bgp * soft in|out' doesn't cause the BGP session to be restarted. It's considered a soft reset as it does not reset the session. This link explains it better than I can: http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_command_reference_chapter09186a00800ca79d.html#1176544

Hope it helps.

Steve

Community Member

Re: BGP route withdrawl and clearing sessions

Thanks for the info.

279
Views
5
Helpful
4
Replies
CreatePlease to create content