Configuring BGP Graceful Shutdown

Information About BGP Graceful Shutdown

The following sections provide information about BGP graceful shutdown.

Purpose and Benefits of BGP Graceful Shutdown

There are times when planned maintenance operations cause routing changes in BGP. After the shutdown of eBGP and iBGP peering sessions between autonomous system border routers (ASBRs), BGP devices are temporarily unreachable during BGP convergence. The goal of gracefully shutting down one or more BGP sessions is to minimize traffic loss during the planned shutdown and subsequent reestablishment of the sessions.

The BGP Graceful Shutdown feature reduces or eliminates the loss of inbound or outbound traffic flows that were initially forwarded along the peering link that is being shut down for maintenance. This feature is primarily for PE-CE, PE-RR and PE-PE links. Lowering the local preference for paths that are received over the session being shutdown renders the affected paths less preferred by the BGP decision process, but still allows the paths to be used during the convergence while alternative paths are propagated to the affected devices. Therefore, devices always have a valid route available during the convergence process.

The feature also allows vendors to provide a graceful shutdown mechanism that does not require any router reconfiguration at maintenance time. The benefits of the BGP Graceful Shutdown feature are fewer lost packets and less time spent reconfiguring devices.

GSHUT Community

The GSHUT community is a well-known community used in conjunction with the BGP Graceful Shutdown feature. The GSHUT community attribute is applied to a neighbor specified by the neighbor shutdown graceful command, thereby gracefully shutting down the link in an expected number of seconds. The GSHUT community is always sent by the GSHUT initiator.

The GSHUT community is specified in a community list, which is referenced by a route map and then used to make policy routing decisions.

The GSHUT community can also be used in the show ip bgp community command to limit output to GSHUT routes.

BGP GSHUT Enhancement

The BGP Graceful Shutdown (GSHUT) Enhancement feature enables graceful shutdown of either all neighbors or only virtual routing and forwarding (VRF) neighbors across BGP sessions. To enable the BGP GSHUT enhancement feature on the device, you must configure either the community keyword or the local-preference keyword in the bgp graceful-shutdown all command. Use the activate keyword to activate graceful shutdown either across all neighbors or only across all VRF neighbors, across all BGP sessions.

How to Configure BGP Graceful Shutdown

The following sections provide configurational information about BGP graceful shutdown.

Filtering BGP Routes Based on the GSHUT Community

Perform this task on a BGP peer to the device where you enabled the BGP Graceful Shutdown feature.

To filter BGP routes based on the GSHUT community, perform this procedure:

Procedure

  Command or Action Purpose

Step 1

enable

Example:


Device>enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:


Device#configure terminal

Enters global configuration mode.

Step 3

router bgp autonomous-system-number

Example:


Device(config)#router bgp 2000

Configures a BGP routing process.

Step 4

neighbor {ipv4-address | ipv6-address } remote-as number

Example:


Device(config-router)#neighbor 2001:db8:4::1 remote-as 1000

Configures the autonomous system (AS) to which the neighbor belongs.

Step 5

neighbor {ipv4-address | ipv6-address } activate

Example:


Device(config-router)#neighbor 2001:db8:4::1 activate

Activates the neighbor.

Step 6

neighbor {ipv4-address | ipv6-address } send-community

Example:


Device(config-router)#neighbor 2001:db8:4::1 send-community

Enables BGP community exchange with the neighbor.

Step 7

exit

Example:


Device(config-router)#exit

Exits router configuration mode.

Step 8

route-map map-tag [permit | deny ] [sequence-number ]

Example:


Device(config)#route-map RM_GSHUT deny 10

Configures a route map to permit or deny routes for policy routing.

Step 9

match community {standard-list-number | expanded-list-number | community-list-name [exact ]}

Example:


Device(config-route-map)#match community GSHUT

Configures that the routes that match ip community-list GSHUT will be policy routed.

Step 10

exit

Example:


Device(config-route-map)#exit

Exits route-map configuration mode.

Step 11

ip community-list {standard | standard list-name} {deny | permit} gshut

Example:


Device(config)#ip community-list standard GSHUT permit gshut

Configures a community list and permits or denies routes that have the GSHUT community to the community list.

If you specify other communities in the same statement, there is a logical AND operation and all communities in the statement must match the communities for the route in order for the statement to be processed.

Step 12

router bgp autonomous-system-number

Example:


Device(config)#router bgp 2000

Configures a BGP routing process.

Step 13

neighbor address route-map map-name in

Example:


Device(config)#neighbor 2001:db8:4::1 route-map RM_GSHUT in

Applies the route map to incoming routes from the specified neighbor.

In this example, the route map that is named RM_GSHUT denies routes from the specified neighbor that have the GSHUT community.

Configuring BGP GSHUT Enhancement

To configure BGP GSHUT enhancement, perform this procedure:

Procedure

  Command or Action Purpose

Step 1

enable

Example:


Device>enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:


Device#configure terminal

Enters global configuration mode.

Step 3

router bgp autonomous-system-number

Example:


Device(config)#router bgp 65000

Enters router configuration mode to create or configure a BGP routing process.

Step 4

bgp graceful-shutdown all {neighbors | vrfs} shutdown-time {community community-value [local-preference local-pref-value] | local-preference local-pref-value [community community-value]}

Example:


Device(config-router)#bgp graceful-shutdown all neighbors 180 local-preference 20 community 10

Enables the BGP GSHUT enhancement feature on the device.

Step 5

bgp graceful-shutdown all {neighbors | vrfs} activate

Example:


Device(config-router)#bgp graceful-shutdown all neighbors activate

Activates graceful shutdown across all neighbors or only across VRF neighbors for BGP sessions.

Step 6

end

Example:


Device(config-router)#end

Returns to privileged EXEC mode.

Step 7

show ip bgp

Example:


Device#show ip bgp neighbors 10.2.2.2 | include shutdown

Displays entries in the BGP routing table.

Step 8

show running-config

Example:


Device#show running-config | session router bgp

Displays running configuration on the device.

Configuration Examples for BGP Graceful Shutdown

The following sections provide configuration examples for BGP graceful shutdown.

Example: Filtering BGP Routes Based on the GSHUT Community

In additional to being able to gracefully shut down a BGP route, another use of the GSHUT community is to configure a community list to filter routes with this community from getting into the BGP routing table.

This example illustrates how to use a community list to filter incoming BGP routes based on the GSHUT community. In this example, a route map that is named RM_GSHUT denies routes based on a standard community list named GSHUT. The community list contains routes with the GSHUT community. The route map is then applied to incoming routes from the neighbor at 2001:db8:4::1.


Device(config)#router bgp 2000
Device(config-router)#neighbor 2001:db8:4::1 remote-as 1000
Device(config-router)#neighbor 2001:db8:4::1 activate
Device(config-router)#neighbor 2001:db8:4::1 send-community
Device(config-router)#exit
Device(config)#route-map RM_GSHUT deny 10
Device(config-route-map)#match community GSHUT
Device(config-route-map)#exit
Device(config)#ip community-list standard GSHUT permit gshut
Device(config)#router bgp 2000
Device(config)#neighbor 2001:db8:4::1 route-map RM_GSHUT in

Example: BGP GSHUT Enhancement

The following example shows how to enable and activate the BGP GSHUT enhancement feature across all neighbors. In this example, the neighbors are configured to gracefully shutdown within the specified duration of 180 seconds.


Device>enable
Device#configure terminal
Device(config)#router bgp 65000
Device(config-router)#bgp graceful-shutdown all neighbors 180 local-preference 20 community 10
Device(config-router)#bgp graceful-shutdown all neighbors activate
Device(config-router)#end

Following is sample output from the show ip bgp command, which displays the graceful shutdown time for each neighbor. In this example, there are two IPv4 neighbors that are configured with IP address 10.2.2.2 and 172.16.2.1 and one VRF neighbor, tagged v1, is configured with IP address 192.168.1.1.


Device#show ip bgp neighbors 10.2.2.2 | include shutdown

Graceful Shutdown Timer running, schedule to reset the peer in 00:02:47 seconds
Graceful Shutdown Localpref set to 20
Graceful Shutdown Community set to 10

Device#show ip bgp neighbors 172.16.2.1 | include shutdown

Graceful Shutdown Timer running, schedule to reset the peer in 00:02:38 seconds
Graceful Shutdown Localpref set to 20
Graceful Shutdown Community set to 10

Device#show ip bgp vpnv4 vrf v1 neighbors 192.168.1.1 | include shutdown

Graceful Shutdown Timer running, schedule to reset the peer in 00:01:45 seconds
Graceful Shutdown Localpref set to 20
Graceful Shutdown Community set to 10

Following is sample output from the show running-config command, which displays information that is associated with the BGP session in router configuration mode:


Device#show running-config | session router bgp

router bgp 65000
bgp log-neighbor-changes
bgp graceful-shutdown all neighbors 180 local-preference 20 community 10
network 10.1.1.0 mask 255.255.255.0
neighbor 10.2.2.2 remote-as 40
neighbor 10.2.2.2 shutdown
neighbor 172.16.2.1 remote-as 10
neighbor 172.16.2.1 shutdown
!
address-family vpnv4
neighbor 172.16.2.1 activate
neighbor 172.16.2.1 send-community both
exit-address-family
!
address-family ipv4 vrf v1
neighbor 192.168.1.1 remote-as 30
neighbor 192.168.1.1 shutdown
neighbor 192.168.1.1 activate
neighbor 192.168.1.1 send-community both
exit-address-family

Additional References

Related Documents

Related Topic

Document Title

BGP commands

Cisco IOS IP Routing: BGP Command Reference

Standards and RFCs

Standard/RFC

Title

RFC 6198

Requirements for the Graceful Shutdown of BGP Sessions

Feature History for BGP Graceful Shutdown

This table provides release and related information for the features explained in this module.

These features are available in all the releases subsequent to the one they were introduced in, unless noted otherwise.

Release

Feature

Feature Information

Cisco IOS XE Gibraltar 16.11.1

BGP Graceful Shutdown

The BGP Graceful Shutdown feature reduces or eliminates the loss of inbound or outbound traffic flows that were initially forwarded along the peering link that is being shut down for maintenance.

Cisco IOS XE Cupertino 17.7.1

BGP Graceful Shutdown

Support for this feature was introduced on the Cisco Catalyst 9600 Series Supervisor 2 Module (C9600X-SUP-2).

Use the Cisco Feature Navigator to find information about platform and software image support. To access Cisco Feature Navigator, go to https://cfnng.cisco.com/