Configuring LDP graceful restart (GR)

By default LDP GR is disabled. You can globally enable it. When LDP GR enabled, the router waits until it receives an LDP Initialization message from its neighbor to know whether it must delete its states or start the LDP GR recovery procedure. Also, LDP GR is applicable to all LDP sessions regardless of the adjacency type exists between the neighbors.

Note

Note

The following commands only take effect on newly created sessions. For existing sessions, it is required that the sessions be restarted for the new configuration to take effect.
  1. In privileged EXEC mode, enter global configuration mode.
    device# configure terminal
  2. Enable MPLS on the device.
    device(config)# router mpls
  3. Access LDP configuration mode.
    device(config-router-mpls)# ldp
  4. Enable LDP GR and access GR configuration mode.
    device(config-router-mpls-ldp)# graceful-restart
    
  5. If you are configuring the router as an LSR acting as a GR helper, use the helper-only command.
    device(config-router-mpls-ldp-gr)# helper-only
    In helper mode, the commands for reconnect time and recovery time are rejected with informational messages. If you do not configure this command, the router acts as a restarting LSR.
  6. Specify the session reconnect time.
    device(config-router-mpls-ldp-gr)# graceful-restart reconnect-time 150
    
  7. Specify the amount of time that this device retains its MPLS forwarding state across LDP GR.
    device(config-router-mpls-ldp-gr)# graceful-restart recovery-time 240
    
  8. Specify the maximum amount of time to wait for a neighbor to reconnect.
    device(config-router-mpls-ldp-gr)# graceful-restart max-neighbor-reconnect-time 150
    
  9. Specify the maximum amount of time to wait for a neighbor to recover.
    device(config-router-mpls-ldp-gr)# graceful-restart max-neighbor-recovery-time 240
    
  10. Verify that graceful restart is enabled.
    device# show mpls ldp
    Label Distribution Protocol version 1
      LSR ID: 10.210.210.21, using Loopback 1 (deleting it stops LDP)
      Hello interval: Link 5 sec, Targeted 15 sec
      Hold time value sent in Hellos: Link 15 sec, Targeted 45 sec
      Keepalive interval: 6 sec, Hold time multiple: 6 intervals
      Load sharing: 8
      Tunnel metric: 0
      FEC used for auto discovered peers: current 129, configured 129
      Graceful restart: enabled
        Reconnect time: 150 seconds, Max peer reconnnect time: 150 seconds
        Recovery time: 240 seconds, Max peer recovery time: 240 seconds
        Forwarding state holding timer: not running

Example

The following example shows the previous steps to configure LDP GR.

device# configure terminal
device(config)# router mpls
device(config-router-mpls)# ldp
device(config-router-mpls-ldp)# graceful-restart
device(config-router-mpls-ldp-gr)# graceful-restart reconnect-time 150
device(config-router-mpls-ldp-gr)# graceful-restart recovery-time 240
device(config-router-mpls-ldp-gr)# graceful-restart max-neighbor-reconnect-time 150
device(config-router-mpls-ldp-gr)# graceful-restart max-neighbor-recovery-time 240
device(config-router-mpls-ldp-gr)# helper-only

The "helper-only" configuration is mutually exclusive with the recovery and reconnect time configuration. If any of these two timers are configured to non-default value, the helper-only configuration cannot be applied.

device(config-router-mpls-ldp-gr)# helper-only 
%Error: Unconfigure LDP GR timers before configuring GR Helper mode
device(config-router-mpls-ldp-gr)# no recovery-time 
Possible completions:
  <cr>
device(config-router-mpls-ldp-gr)# no recovery-time 
device(config-router-mpls-ldp-gr)# helper-only 
device(config-router-mpls-ldp-gr)# 

device(config-router-mpls-ldp-gr)# helper-only 
device(config-router-mpls-ldp-gr)# 
device(config-router-mpls-ldp-gr)# 
device(config-router-mpls-ldp-gr)# recovery-time 150
%Error: Unconfigure LDP GR Helper mode before configuring GR timers
device(config-router-mpls-ldp-gr)# no helper-only 
device(config-router-mpls-ldp-gr)# recovery-time 150
device(config-router-mpls-ldp-gr)#