graceful-shutdown (Protocols BGP)
Syntax
graceful-shutdown {
receiver {
disable;
local-preference <value>;
}
sender {
local-preference <value>;
}
}
Hierarchy Level
[edit protocols bgp], [edit protocols bgp group group-name], [edit protocols bgp group group-name neighbor address], [edit logical-systems logical-system-name protocols bgp], [edit logical-systems logical-system-name protocols bgp group group-name], [edit logical-systems logical-system-name protocols bgp group group-name neighbor address]
Description
Configure graceful shutdown feature for BGP. Graceful shutdown migrates traffic from one BGP next-hop to another without interrupting the traffic flow. This feature can be enabled for both IBGP and EBGP. The router on which the graceful shutdown is performed is known as the sender or initiator. The receiver is the router that has a BGP session with the sender router. A device acting as a sender is by default a receiver. In other words, with the sender feature enabled, the receiver feature cannot be disabled on the same device.
The BGP neighbor device must support graceful shutdown feature, without any additional configuration.
On completion of the maintenance window, disabling graceful shutdown is recommended.
Graceful Shutdown: Sender-Side Functionality
When you configure graceful-shutdown sender on your router, it becomes the sender or initiator. The behavior of the sender changes depending on whether the BGP session is E-BGP or I-BGP.
E-BGP
Apply an implicit outbound route policy on the BGP session that you plan to shut down. This policy tags the paths with the
GRACEFUL_SHUTDOWN
community before advertising them. The local-preference value is not advertised over the E-BGP session.Apply an implicit inbound route policy on the same session. Tag the incoming paths with the
GRACEFUL_SHUTDOWN
community and set theLOCAL_PREF
to a lower value (default is zero, but you can configure it).If you configure an explicit local preference using the graceful-shutdown receiver local-pref <val> command, the inbound policy will apply the configured value to incoming routes instead of the default zero.
Ensure that all routes (locally originated, redistributed from other protocols, or learned from peers) are tagged with the
GRACEFUL_SHUTDOWN
community when sent to a peer where you've enabled the sender functionality.
You can control this sender-side functionality using the
graceful-shutdown
configuration statement.
I-BGP or Confederation
Apply an implicit outbound route policy to tag the paths with the
GRACEFUL_SHUTDOWN
community before advertising them over the session.The policy changes the local preference of the advertised routes to zero (default) or a value that you configure in RIB-OUT.
You don't need to take any additional action for incoming routes over the same session.
Graceful Shutdown: Receiver-Side Functionality
When your router receives routes with the GRACEFUL_SHUTDOWN
community, it functions as the receiver. The behavior depends on whether the session
is E-BGP or I-BGP.
E-BGP
Apply an implicit inbound route policy that matches the
GRACEFUL_SHUTDOWN
community and lowers the local preference of the matching paths to the default or a value you configure.By default, the local preference is set to zero. If you prefer to change this value or disable the receiver functionality, you can do so with this configuration statement.
The receiving router will store the routes in the local RIB and re-advertise them to peers without stripping the
GRACEFUL_SHUTDOWN
community.
I-BGP or Confederation
No action is needed for routes received with the
GRACEFUL_SHUTDOWN
community. The local preference is
typically adjusted at the network edge (ASBR). Modifying it within the AS may
lead to suboptimal routing or forwarding loops.
BGP Session Shutdown Functionality
When you configure the BGP session shutdown functionality, it tears down the BGP session and prevents reformation until you remove the configuration statement. While the configuration statement is active, if a peer attempts to establish a BGP session by sending an Open message, your router will send a BGP Cease Notification.
This feature is particularly useful during maintenance windows when your router is in an unstable state. Preventing BGP session formation during this time reduces network churn.
BGP Shutdown Communication Functionality
Instead of relying on offline methods like email or phone calls to inform your peer about a BGP session teardown, you can use the shutdown communication feature to transmit a message as part of a Cease Notification.
This feature supports BGP Cease Notifications with the reasons Administrative Shutdown or Administrative Reset. You can include a UTF-8 encoded string in the notification, at your discretion, explaining why the session is being reset. This is in accordance with RFC 8203.
Default
The graceful shutdown receiver feature is enabled by default.
The graceful shutdown sender feature is disabled by default.
Required Privilege Level
routing—To view this statement in the configuration.
routing-control—To add this statement to the configuration.
Release Information
Statement introduced in Junos OS Release 19.1.