BGP Soft Reconfiguration
BGP Soft Reconfiguration
When we change the BGP routing policy (changing the attributes or adding
filters) we need to reset the BGP session before the new policy takes effect.
This is no problem in a lab but its something you dont want to do in a
production network. In fact, there are 3 methods how you can refresh your
BGP policies:
Hard reset
The hard reset is the most simple method (clear ip bgp command). It kills
the TCP session with your BGP neighbor which forces it to restart and as a
result youll receive all prefixes from your neighbor again. It works, but its
cruel
Dynamic soft reset is the most preferred method, it requires the route
refresh capability. Simply said, this feature lets your router request its BGP
neighbor to send its prefixes again.
Routers that dont support the route refresh capability will have to use the
soft reset option. Thats what this tutorial is about. You can read about
dynamic soft reset / route refresh in my other tutorial.
Normally I talk about prefixes or routes but technically the information that BGP
exchanges in update messages is called NLRI (Network Layer Reachability
Information). The NLRI field contains the prefixes and length.
On the left side we see a table called adj-RIB-in. This is the unedited routing
information from a BGP neighbor. Theres a seperate table for each BGP
neighbor that you peer with. We apply our inbound BGP policy to this
information and the result is a table called the adj-RIB-in, this is the actual
BGP table.
BGP will select the best path from the BGP table and the router will install
this in the routing table. Also, the best paths can be advertised to other BGP
neighbors. We can apply an outbound BGP policy to outbound updates and
when this is done we have a table called adj-RIB-out (per neighbor). The
adj-RIB-in table is actually stored in memory for each neighbor, the adj-RIBout table not.
Now you have an idea about the different tables and how soft reconfiguration
works, lets take a look at this on some BGP routers.
Configuration
To demonstrate the soft reset we only need two routers. R1 has two loopback
interfaces so that we have a couple of networks to advertise:
Nothing special here, we run EBGP and R1 advertises its two loopback
interfaces. By default the soft reset option is disabled, lets configure it on
R2:
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 soft-reconfiguration inbound
This will set the local preference to 200 for all incoming prefixes from R1.
Instead of clearing the TCP session, well do a soft reset:
R2#clear ip bgp 192.168.12.1 soft in
Use the soft in parameter to do a soft reset. Now look at the BGP table first:
R2#show ip bgp
BGP table version is 3, local router ID is 192.168.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
*> 1.1.1.1/32
192.168.12.1
0 200
01i
*> 11.11.11.11/32 192.168.12.1
0 200
01i
The BGP table (loc-RIB) was modified as expected, now take a look at the
adj-RIB-in table:
R2#show ip bgp neighbors 192.168.12.1 received-routes
BGP table version is 3, local router ID is 192.168.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
* 1.1.1.1/32
192.168.12.1
0
01i
* 11.11.11.11/32 192.168.12.1
0
01i
Total number of prefixes 2
Above you see the raw routing information from R1 before we applied the
inbound BGP policy. You can see that no changes were made to the local
preference of my prefixes.
Another nice experiment is to filter some of the prefixes:
R2(config)#access-list 1 permit host 1.1.1.1
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 distribute-list 1 in