Configuring BGP GR

GR ensures forwarding continuous when a routing protocol restarts or an active/standby switchover occurs. Two routers are required to complete a GR process. The following are router roles in a GR process:

A device can act as a GR restarter and GR helper at the same time.

BGP GR works as follows:

  1. The BGP GR restarter and helper exchange Open messages for GR capability negotiation. If both parties have the GR capability, they establish a GR-capable session. The GR restarter sends the GR timer set by the graceful-restart timer restart command to the GR helper in an Open message.

  2. When an active/standby switchover occurs or BGP restarts, the GR restarter does not remove existing BGP routes, and it still uses these routes for packet forwarding. The GR helper marks all routes learned from the GR restarter as stale instead of deleting them, and it still uses these routes for packet forwarding. During the GR process, packet forwarding is not interrupted.

  3. After the active/standby switchover or BGP restart completes, the GR restarter reestablishes a BGP session with the GR helper. If the BGP session fails to be established within the GR timer advertised by the GR restarter, the GR helper removes the stale routes.

  4. If the BGP session is established, routing information is exchanged for the GR restarter to retrieve route entries and for the GR helper to recover stale routes. You can use the graceful-restart timer wait-for-rib command to configure the time for the local router to wait for the End-Of-RIB (End of Routing-Information-Base) marker, and control the route convergence speed. If routing information exchange is not completed within the time, the GR restarter does not receive new routes. Instead, the GR restarter updates its routing table and forwarding table with the BGP routes already learned to complete BGP route convergence. The GR helper removes the stale routes.

Follow these guidelines when you configure BGP GR:

Perform the following configuration on the GR restarter and GR helper.

To configure BGP GR:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP view.

bgp as-number

N/A

3. Enable GR capability for BGP.

graceful-restart

By default, GR capability is disabled for BGP.

4. Configure the GR timer.

graceful-restart timer restart timer

The default setting is 150 seconds.

The time that a peer waits to reestablish a session must be less than the hold time.

5. Configure the maximum time to wait for the End-of-RIB marker.

graceful-restart timer wait-for-rib timer

The default setting is 180 seconds.