Configure BGP Graceful Shutdown

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 Name and Description

Supported Platform

Cisco IOS XE 26.2.1ea

BGP Graceful Shutdown: BGP Graceful Shutdown feature support has been introduced.

Cisco C9550 Series Smart Switches

Cisco IOS XE 17.18.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 C9350 Series Smart Switches

Cisco C9610 Series Smart Switches

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/.

Information about BGP graceful shutdown

This sections provide information about BGP graceful shutdown.

BGP graceful shutdown benefits

BGP graceful shutdown benefits are network advantages that

  • reduce or eliminate the loss of inbound or outbound traffic flows during planned BGP session shutdowns

  • minimize traffic loss during the planned shutdown and subsequent reestablishment of sessions, and

  • provide fewer lost packets and less time spent reconfiguring devices.

Graceful shutdown operation

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.

GSHUT community

A GSHUT community is a well-known community attribute that

  • is applied to a neighbor to gracefully shut down the link in an expected number of seconds

  • is used in conjunction with the BGP Graceful Shutdown feature, and

  • is always sent by the GSHUT initiator.

GSHUT community usage

The GSHUT community attribute is applied to a neighbor specified by the neighbor shutdown graceful command.

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.

Configure BGP GSHUT enhancement

Configure BGP GSHUT enhancement to enable graceful shutdown functionality for BGP sessions, allowing for controlled network maintenance operations.

Use this feature when you need to perform maintenance on BGP routers while minimizing traffic disruption. The BGP GSHUT enhancement provides a mechanism to gracefully shutdown BGP sessions with specific timing and community attributes.

Procedure


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.


BGP GSHUT enhancement is now configured and activated. The graceful shutdown functionality is enabled for BGP sessions with the specified timing and community attributes.

Configure BGP graceful shutdown

BGP graceful shutdown provides configurational capabilities for managing BGP session termination.

Summary

BGP graceful shutdown allows network administrators to manage BGP session termination in a controlled fashion, reducing disruption and ensuring seamless rerouting during maintenance or shutdown procedures.

The key components involved in the process are:

  • Network administrator: Initiates and manages the BGP graceful shutdown configuration process.

  • BGP router: Receives and applies the graceful shutdown configuration settings.

Workflow

The process involves the following stages:

  1. The network administrator accesses the BGP router configuration interface.
  2. The administrator applies the graceful shutdown settings on the router.
  3. The BGP router recognizes the graceful shutdown configuration and signals its peers accordingly.

Result

The BGP session terminates in a controlled manner, allowing neighboring routers to reroute traffic and minimize service interruption during maintenance or shutdown.

Filter BGP routes based on the GSHUT community

Filter BGP routes that have the GSHUT community to control route acceptance from peers during graceful shutdown scenarios.

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

Before you begin

Follow these steps to filter BGP routes based on the GSHUT community:

Procedure


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.


The route map is configured to deny incoming BGP routes that have the GSHUT community from the specified neighbor, effectively filtering them from the routing table.

Configure BGP GSHUT enhancement

Configure BGP GSHUT enhancement to enable graceful shutdown functionality for BGP sessions, allowing for controlled network maintenance operations.

Use this feature when you need to perform maintenance on BGP routers while minimizing traffic disruption. The BGP GSHUT enhancement provides a mechanism to gracefully shutdown BGP sessions with specific timing and community attributes.

Procedure


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.


BGP GSHUT enhancement is now configured and activated. The graceful shutdown functionality is enabled for BGP sessions with the specified timing and community attributes.

Configuration examples for BGP graceful shutdown

These sections provide configuration examples for BGP graceful shutdown.

Filter BGP routes based on the GSHUT community

Filter routes with the GSHUT community from getting into the BGP routing table using a community list and route map configuration.

In addition 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 configuration uses a route map that denies routes based on a standard community list containing routes with the GSHUT community. The route map is then applied to incoming routes from a specific neighbor.

Procedure


Step 1

Configure the BGP router process and neighbor settings.

Example:


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

Step 2

Create a route map that denies routes based on the community list.

Example:


Device(config)#route-map RM_GSHUT deny 10
Device(config-route-map)#match community GSHUT
Device(config-route-map)#exit

Step 3

Create a standard community list for the GSHUT community.

Example:


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

Step 4

Apply the route map to incoming routes from the neighbor.

Example:


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

The route map RM_GSHUT filters incoming BGP routes from neighbor 2001:db8:4::1, denying routes that contain the GSHUT community from entering the BGP routing table.

Configure BGP GSHUT enhancement

Enable and activate the BGP GSHUT enhancement feature to configure neighbors for graceful shutdown within a specified time duration.

The BGP GSHUT enhancement allows you to gracefully shutdown BGP neighbors with specific parameters such as local preference and community values. This example demonstrates configuration for multiple neighbor types including IPv4 and VRF neighbors.

Procedure


Step 1

Enable privileged EXEC mode and enter global configuration mode.

Example:

Device>enable
Device#configure terminal

Step 2

Configure BGP router mode and enable graceful shutdown for all neighbors.

Example:

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

In this configuration, neighbors are set to gracefully shutdown within 180 seconds with local-preference set to 20 and community value set to 10.

Step 3

Verify the graceful shutdown configuration for specific neighbors.

Example:

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

This example shows two IPv4 neighbors configured with IP addresses 10.2.2.2 and 172.16.2.1, and one VRF neighbor tagged v1 with IP address 192.168.1.1.

Step 4

Display the running configuration to verify BGP session information.

Example:

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

The BGP GSHUT enhancement is successfully configured and activated. Neighbors will gracefully shutdown within the specified 180-second duration with the configured local preference and community values. The configuration can be verified using the show commands to display graceful shutdown timers and running configuration details.

Additional references

This reference provides additional documentation and standards related to BGP graceful shutdown implementation.

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