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
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.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)# helper-only
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# 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
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)#