For an LDP session between routers, you must configure LDP on an interface to allow the device to advertise its loopback interface to the peers.
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.
Note
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.
device(config)# router mpls
device(config-router-mpls)# mpls-interface ethernet 0/2
device(config-router-mpls-if-eth-0/2-ldp-params)# ldp-enable
device(config-router-mpls-if-eth-0/2-ldp-params)#)# Ctrl-z
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