Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
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.


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

00:03:59: BGP: nettable_scan: invalidate sourced path for

00:03:59: BGP: no valid path for

00:04:00: BGP: nettable_walker no best path

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

00:04:00: BGP: send UPDATE -- unreachable

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

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

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 route sourced locally

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

00:07:00: BGP: send UPDATE, next, metric 0, path 1

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

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

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.


Community Member

Re: BGP route withdrawl and clearing sessions


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:

Hope it helps.


Community Member

Re: BGP route withdrawl and clearing sessions

Thanks for the info.

CreatePlease to create content