Configuring LDP on an Interface

To use LDP, configure a loopback address with a 32-bit mask on the LSR. The first loopback address configured on the device is used in its LDP identifier. When the loopback address used in the LDP identifier is removed, all LDP functions on the LSR are shut down. LDP sessions between the LSR and its peers are terminated, and LDP-created tunnels are removed. When other loopback interfaces are configured on the device, the lowest-numbered loopback address is used as a new LDP identifier. LDP sessions and tunnels are set up using this new LDP identifier.

Configure LDP on the same set of interfaces that IGP routing protocols such as OSPF and IS-IS are enabled.


For an LDP Session to be established between two routers, the best IGP path between them must be a non-IP over MPLS path. If the best path transits an MPLS tunnel, the LDP session is not formed between the devices. A non-IP over MPLS path can be ensured by setting the cost/metric of the path.

To configure LDP on an interface, perform the following steps.

  1. In privileged EXEC mode, enter global configuration mode.
  2. Enable MPLS on the device.
    device(config)# router mpls
  3. Enable MPLS on an interface.
    device(config-router-mpls)# mpls-interface ethernet 0/2
    For example, MPLS is enabled on the interface at Ethernet 0/2.
  4. Enable LDP on the interface.
    device(config-router-mpls-if-eth-0/2-ldp-params)# ldp-enable
  5. Return to privileged EXEC mode.
    device(config-router-mpls-if-eth-0/2-ldp-params)#)# Ctrl-z
  6. Verify the configuration of the interface.
    device# show mpls ldp interface
    	         Label-space	Nbr	  Hello	   Next
    Interface	ID	         Count	Interval	Hello
    e0/2	     0	          1	    5	       0 sec


The following example shows the previous steps to configure LDP on an interface.

device# configure 
device(config)# router mpls
device(config-router-mpls)# mpls-interface ethernet 0/2
device(config-router-mpls-if-eth-0/2)# ldp-params
device(config-router-mpls-if-eth-0/2-ldp-params)# ldp-enable