Configuring the LDP session keepalive interval

If the ka-timeout command is configured on your device, you must explicitly remove its configuration with the no ka-timeout command before you change the keepalive interval. For example:
device(config-router-mpls-ldp)# ka-timeout 40
%Warn: Please clear LDP sessions for the new KA parameter value to take effect on existing sessions
device(config-router-mpls-ldp)# ka-interval 11
%Error: ka-timeout needs to be unconfigured before ka-interval is configured
device(config-router-mpls-ldp)# no ka-timeout
%Warn: Please clear LDP sessions for the new KA parameter value to take effect on existing sessions
device(config-router-mpls-ldp)# ka-interval 11
%Warn: Please clear LDP sessions for the new KA parameter value to take effect on existing sessions
To configure the keepalive intervals, perform the following steps.
  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. Set the keepalive time interval at which the session keepalive message is sent when no other LDP protocol message is sent to the LDP peer.
    device(config-router-mpls-ldp)# ka-interval 10
    %Warn: Please clear LDP sessions for the new KA parameter value to take effect on existing sessions
    
    In this example, the keepalive interval is 10 seconds. The possible values are 1 through 65535. A warning is displayed whenever the ka-interval value is changed.
  5. Configure the number of keepalive intervals after which the session is terminated when no session keepalive or other LDP protocol message is received from the LDP peer.
    device(config-router-mpls-ldp)# ka-int-count 3
    %Warn: Please clear LDP sessions for the new KA parameter value to take effect on existing sessions
    
    In this example, the number of intervals is set to 10.
  6. Verify the keepalive interval configuration.
    device # show mpls ldp
    Label Distribution Protocol version 1 (deleting it will stop LDP)
     LSR ID: 10.122.122.122, using Loopback 1
     Hello interval: Link 5 sec, Targeted 15 sec
     Hold time value sent in Hellos: Link 15 sec, Targeted 45 sec 
     Keepalive interval: 10 sec, Hold time multiple: 3 intervals 
     Keepalive timeout: 30 sec
     Load sharing: 8
     Tunnel metric: 0
     FEC used for auto discovered peers: current 129, configured 129
     End of LIB: Disabled, Notification time: 60000 ms, tx label silence time: 1000 ms
     Rx label silence time: 1000 ms
     Graceful restart: disabled
      Reconnect time: 0 seconds, Max peer reconnect time: 120 seconds 
      Recovery time: 0 seconds, Max peer recovery time: 120 seconds 
      Forwarding state holding timer: not running
     Label Withdrawal delay: 60 seconds (Default)
    When the keepalive interval is configured, the keepalive timeout value displays as the product of keepalive interval * keepalive interval count. In this example, the keepalive timeout set to 30.

The following example is the configuration of the previous steps.

device# configure terminal
device(config)# router mpls
device(config-router-mpls)# ldp
device(config-router-mpls-ldp)# ka-interval 10
device(config-router-mpls-ldp)# ka-int-count 3