Sei sulla pagina 1di 8

If you have basic knowledge, skip to Cheat Sheet and Useful Commands.

BGP Route Refresh Capability


Allows a BGP instance to request a BGP peer to re-advertise all its routes towards the requesting BGP speaker. This can be done without any disruption to the forwarding plane. This can be used for a few purposes. Firstly it can be used when there has been an update to the ingress routing policy, secondly it can be used to refresh routes when there has been some corruption of the BGP routing table. On Cisco platforms, BGP capabilities are negotiated when neighbors come up. To find out if route refresh capability is supported locally and by the BGP peer then use the following command
#sh ip bgp neighbors 10.1.1.1 | s Neighbor capabilities:
Neighbor capabilities: Route refresh: advertised and received (old & new)

To initiate a BGP route refresh then use one of the following commands
# clear ip bgp 1.1.1.1 soft ! If no direction specified, affect both direction. # clear ip bgp 1.1.1.1 (soft) in ! Effect inbound. Soft keyword could be left, still same affect.

At a packet level then the requesting BGP peer will send a ROUTE-REFRESH message (as shown below) and the responding peer will simply send a standard UPDATE message.

When we enable soft reconfiguration then BGP route refresh capability is no longer used, we will discuss this further near the end.

Soft Reconfiguration
To configure soft reconfiguration we do the following
(config) # router bgp 179 (config-rtr)# neighbor 10.1.1.1 soft-reconfiguration inbound

Or we can also configure the router to configure BGP sessions with soft reconfiguration only when BGP route refresh capability is not supported by our BGP peer.
(config-rtr)# bgp soft-reconfig-backup

When we have soft reconfiguration configured, Cisco router starts to keep a copy of adj-RIB-in. 1. When BGP receives routes from a peer it places them into adj-RIB-in unaltered 2. Routes in adj-RIB-in are then passed through inbound routing policy and go into locRIB. Loc-RIB is essentially the best paths of the BGP RIB. 3. Adj-RIB-out is a table of routes after they have passed through the outbound routing policy. Therefore there is an adj-RIB-out for each peer-group. In short Adj-RIB-in = table before inbound routing policy Loc-RIB = table after inbound routing policy (best paths of BGP) Adj-RIB-out = table after outbound routing policy

# sh ip bgp neighbors 10.1.1.1 received-routes ! Show routes received from 10.1.1.1 before inbound routing policy. ! In other words, show adj-RIB-in table for 10.1.1.1 peer. # sh ip bgp neighbors 10.1.1.1 routes ! Show routes received from 10.1.1.1 after inbound routing policy. ! In other words, show loc-RIB table for 10.1.1.1 peer. # sh ip bgp neighbors 10.1.1.1 advertised-routes ! Show routes advertised to 10.1.1.1 peer after outbound routing policy. ! In other words, show adj-RIB-out table for 10.1.1.1 peer.

And to refresh routes from the adj-RIB-in to the loc-RIB we can use the following commands
# clear ip bgp 1.1.1.1 soft ! If no direction specified, affect both direction. # clear ip bgp 1.1.1.1 (soft) in ! Effect inbound. Soft keyword could be left, still same affect.

So we can see straight away that the behavior of the above two clear commands differs depending on whether soft reconfiguration is enabled or not.

Route Refresh Capability vs Soft Reconfiguration


To summarise then I will try to note the pros and cons below. When soft reconfiguration is enabled and there is some memory corruption on the adj-RIB-in then the only way to refresh the routes is to do a hard reset of the BGP peering (NOTE: actually if we have control of the remote peer we can still do a clear ip bgp out). With BGP route refresh capability, if routes in the loc-RIB get corrupted we can refresh the routes dynamically without any disruption to service. This may be a moot point, but consider the fact that BGP peers can stay up for years at a time and have full Internet routing tables. For Tier 1 ISP networks this is a real issue. For IGPs we continually refresh the routes across the network (ie every 30 mins for OSPF), this is not the case for BGP. In fact if you have ever encountered strange routing issues which were solved by bouncing the BGP peer, this is probably the exact issue you saw. Soft reconfiguration inbound will use more memory than route refresh capability. However conversely, route refresh capability will use network bandwidth when we refresh routes, which can be significant on smaller links. Soft reconfiguration inbound is useful to see the BGP routes learned before policy is applied. Therefore it can be used for inbound policy troubleshooting. I always use this feature when I bring up a new BGP peer so I can check the correct routes are being learnt before we allow the routes through our policy. Lastly we should consider Ciscos recommendation on this matter. If we refer to the command reference here we can see the following statement using the neighbor soft-reconfiguration command has a negative effect on network operations and should only be used as a last resort. Soft reconfiguration inbound predates BGP route refresh capability and we should use the new feature in production configurations. However soft reconfiguration can still be useful for service turn up and troubleshooting.

Ref http://jaluther.blogspot.com/2012/04/bgp-route-refresh-capability.html

BGP Session Reset


Whenever the routing policy changes due to a configuration change, BGP peering sessions must be reset by using the clear ip bgp command. Cisco software supports the following three mechanisms to reset BGP peering sessions:

Hard reset
A hard reset tears down the specified peering sessions including the TCP connection and deletes routes coming from the specified peer.

Soft reset
A soft reset uses stored prefix information to reconfigure and activate BGP routing tables without tearing down existing peering sessions. Soft reconfiguration uses stored update information, at the cost of additional memory for storing the updates, to allow you to apply new BGP policy without disrupting the network. Soft reconfiguration can be configured for inbound or outbound sessions.

Dynamic inbound soft reset (Route Refresh)


The route refresh capability, as defined in RFC 2918, allows the local device to reset inbound routing tables dynamically by exchanging route refresh requests to supporting peers. The route refresh capability does not store update information locally for non-disruptive policy changes. It instead relies on dynamic exchange with supporting peers. Route refresh must first be advertised through BGP capability negotiation between peers. All BGP devices must support the route refresh capability. To determine if a BGP device supports this capability, use the show ip bgp neighbors command. The following message is displayed in the output when the device supports the route refresh capability: Received route refresh capability from peer. The bgp soft-reconfig-backup command was introduced to configure BGP to perform inbound soft reconfiguration for peers that do not support the route refresh capability. The configuration of this command allows you to configure BGP to store updates (soft reconfiguration) only as necessary. Peers that support the route refresh capability are unaffected by the configuration of this command.

Type of Reset Hard reset

Advantages No memory overhead.

Disadvantages The prefixes in the BGP, IP, and Forwarding Information Base (FIB) tables provided by the neighbor are lost. A hard reset is not recommended. Does not reset inbound routing table updates. Both BGP devices must support the route refresh capability. Does not reset outbound routing table updates.

Outbound soft reset

No configuration, and no storing of routing table updates. Does not clear the BGP session and cache.

Dynamic inbound soft reset

Does not require storing of routing table updates, and has no memory overhead. Note Configured inbound soft reset (uses the neighbor softreconfiguration router configuration command)

Can be used when both BGP Requires preconfiguration. devices do not support the automatic route refresh Stores all received (inbound) capability. routing policy updates without modification; is memoryThe bgp soft-reconfig-backup intensive. command was introduced to configure inbound soft Recommended only when reconfiguration for peers that absolutely necessary, such as do not support the route when both BGP devices do refresh capability. not support the automatic route refresh capability. Does not reset outbound routing table updates.

Note

Ref http://www.cisco.com/en/US/docs/ios-xml/ios/iproute_bgp/configuration/xe-3se/3850/irg-soft-reset.html

1. Except for clear ip bgp * and clear ip bgp neighbor-id, all are soft resets. 2. If no direction is specified, then will be both direction. 3. Using soft keyword or not, result will be same.

Cheat Sheet
1. By default, BGP router uses Route Refresh capability if it supports. 2. With route refresh, clear ip bgp IP soft command works this way: a. At a packet level then the requesting BGP peer will send a ROUTE-REFRESH

message and the responding peer will simply send a standard UPDATE message. 3. If no route refresh, or even if route refresh is supported, soft reconfiguration can be used.
a. (config-rtr)# bgp soft-reconfig-backup command enable soft reconfiguration on BGP router which doesnt support route refresh. b. (config-rtr)# neighbor 10.1.1.1 soft-reconfiguration inbound command enable soft reconfiguration for 10.1.1.1 peer in the presence of route refresh support. 4. With soft reconfiguration, clear ip bgp IP soft works this way. a. Refresh routes from the adj-RIB-in (pre inbound policy table) to the loc-RIB (post

inbound policy table). 5. Route refresh is preferred in Cisco docs. However, soft reconfiguration is useful for troubleshooting purpose as you can examine pre inbound policy table.
a. E.g. # sh ip bgp neighbors 10.1.1.1 received-routes command only works if soft reconfiguration is enabled for that peer 10.1.1.1.

Useful Commands
#sh ip bgp neighbors 10.1.1.1 | s Neighbor capabilities: ! Show whether route refresh is supported on router. If supported, this output will be shown
Neighbor capabilities: Route refresh: advertised and received (old & new)

(config-rtr)# neighbor 10.1.1.1 soft-reconfiguration inbound ! Enable soft reconfiguration for neighbor 10.1.1.1. (config-rtr)# bgp soft-reconfig-backup ! Enable soft reconfiguration only if route refresh isnt supported.

# sh ip bgp neighbors 10.1.1.1 received-routes ! Show routes received from 10.1.1.1 before inbound routing policy. ! In other words, show adj-RIB-in table for 10.1.1.1 peer. ! Command works only if soft reconfiguration is enabled for that peer. # sh ip bgp neighbors 10.1.1.1 routes ! Show routes received from 10.1.1.1 after inbound routing policy. ! In other words, show loc-RIB table for 10.1.1.1 peer.

# sh ip bgp neighbors 10.1.1.1 advertised-routes ! Show routes advertised to 10.1.1.1 peer after outbound routing policy.

! In other words, show adj-RIB-out table for 10.1.1.1 peer. # clear ip bgp 1.1.1.1 soft ! If no direction specified, affect both direction. # clear ip bgp 1.1.1.1 (soft) in ! Effect inbound. Soft keyword could be left, still same affect.

Potrebbero piacerti anche