ccie blog

Route Refresh vs Soft Reconfiguration

When adjusting inbound policies with BGP, you must request that updates are re-sent from our peer. Remember that BGP UPDATES are incremental, meaning after the initial exchange of complete routing information, we only receive changes.  So we need a way of telling our peer to send us a BGP UPDATE message with all the NLRI so that we can re-run everything through the new filter.  There are various ways of doing this, either:

  • A hard reset – dropping/re-establishing TCP sessions to our peer, forcing all NLRI to be sent again
  • A soft reset – uses the route-refresh capability to request all NLRI be sent again
  • Or a soft-reconfiguration – storing all unedited, unfiltered NLRI sent from our neighbor, in a separate table so that we can run it through our new filter locally.

What is the Route-Refresh Capability?

After establishing a TCP session to a BGP peer, the BGP OPEN message is sent.  The OPEN message advertises the following information about itself:

  • BGP Version (usually version 4)
  • BGP AS Number
  • Hold Time
  • BGP Identifier (BGP router-id)
  • Optional Parameters (includes the router’s BGP capabilities, such as; authentication, multi protocol support, & route-refresh)

As long as the route refresh capability is supported, we are able to use the feature.  If we want to check whether our neighbor supports it, we can use the following command:

R1#sh ip bgp neighbors 192.168.0.2 | s Neighbor capabilities
  Neighbor capabilities:
    Route refresh: advertised and received(old & new)
    Address family IPv4 Unicast: advertised and received

If it does support it, we can use the following command to request a route-refresh:

R1#clear ip bgp 192.168.0.2 in

We can verify that we only requested a route refresh by enabling a couple of debug commands:

R1#debug ip bgp in
R1#debug ip bgp updates
R1#clear ip bgp 192.168.0.2 in
*Mar  1 00:04:32.031: BGP: 192.168.0.2 sending REFRESH_REQ(5) for afi/safi: 1/1
*Mar  1 00:04:32.031: BGP: 192.168.0.2 send message type 5, length (incl. header) 23

As you can see, the first debug message we get veifies that we only requested a route refresh (i.e. didn’t reset the BGP session).

What is soft-reconfiguration inbound?

This feature can be used if route refresh capability is not supported.  Because we are now unable to send a route-refresh request to our neighbor, we actually have to store an unedited, unfiltered copy all the BGP routes delivered in the BGP update from our peer. We can then adjust our filters, and run the unedited copy of the NLRI through our new filter locally.

Before doing anything, I need to talk about how BGP routes are propagated into the BGP table, and out to a BGP speaker.  The process is

Adj-RIBs-In —> Loc-RIB —> Adj-RIBs-Out

The Adj-RIBs-In stores UPDATE messages from other BGP speakers. These are un-edited routes received from our neighbor.  Next, our inbound policy is applied, and routes that pass through the policy & have a valid/resolvable next hop, are put into the Loc-RIB. The rest of the routes in the Adj-RIBs-In are discarded.

The Adj-RIBs-Out stores routing information that the BGP speaker will advertise to its peers (i.e. routes that have passed through outbound policies & will be sent in the BGP UPDATE messages to other peers). This is actually just a pointer back to the record in the Loc-RIB.

Soft reconfiguration allows you to store a copy of the Adj-RIB-in.  We can configure it by using the commands below

R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.0.2 soft-reconfiguration inbound
R1(config-router)#end

The #clear ip bgp soft in allows the routes now stored in the Adj-RIB-In to be run through our new filters and into the Loc-RIB again.

10 Comments

AmarAugust 10th, 2012 at 10:52 am

Nice post buddy..!! 🙂

YasirSeptember 20th, 2013 at 1:49 pm

Nice article.. Thanks

Eslam DaoudApril 17th, 2015 at 6:19 am

Great Explanation .. Thanks..

wanglfJune 16th, 2015 at 12:44 am

Clear explanation, thanks.

KhalidologySeptember 7th, 2015 at 3:14 pm

That’s a very good explaination clearly you are an Awesome Engineer !

adityaOctober 9th, 2015 at 8:26 am

i have a question. if route refresh capability is supported, and i’m not activated soft-reconfiguration inbound. whether the command “clear ip bgp soft in” can still be used to apply new policy?

StephenGarbettOctober 15th, 2015 at 8:32 am

No, I don’t believe so. The reason why is because soft-reconfiguration stores an unfiltered bunch of routes from a peer in a table. Without that configuration, it doesn’t have that table to push through the new inbound bgp policy. It would need to explicitly be a complete bunch of routes from the neighbor as opposed to a stored table of routes that the neighbor gave us earlier.

NitinFebruary 18th, 2016 at 7:31 pm

Will executing clear ip bgp * in reset the BGP neighborship if Route Refresh capability is supported ?

StephenGarbettApril 18th, 2017 at 10:50 am

No. If you include the word “in” at the end, as you have. Then the neighborship will not be reset. Just a route-refresh will occur.

pardeep kaurJune 22nd, 2016 at 5:21 pm

Great Explanation.. Thanks!!

Leave a comment

Your comment