OcNOS-SP : Multi-Protocol Label Switching Guide : Multi-Protocol Label Switching Configuration Guide : LDP Configuration : Configure LDP
Configure LDP
The enable-ldp ipv4 command is used to enable LDP for IPv4 on a specified interface, as follows:
enable-ldp ipv4 enables only IPv4 on the interface
For the examples covered in this section, the command enable-ldp ipv4 is used.
Enable Label Switching
Running LDP on a system requires the following tasks:
1. Enabling label-switching on the interface on NSM.
2. Enabling LDP on an interface in the LDP daemon.
3. Running an IGP (Internal Gateway Protocol), for example, OSPF, to distribute reachability information within the MPLS cloud.
4. Configuring the transport address.
Figure 11-21: Basic LDP Topology
R1 - NSM
 
#configure terminal
Enter configure mode.
(config)#interface xe1
Specify the interface (xe1) to be configured.
(config-if)#ip address 10.10.10.1/24
Assign IP address to interface.
(config-if)#label-switching
Enable label switching on interface xe1.
(config-if)#exit
Exit interface mode.
(config)#interface lo
Specify the loopback (lo) interface to be configured.
(config-if)#ip address 192.168.0.1/32 secondary
Set the IP address of the loopback interface to 192.168.0.1/32.
(config-if)#commit
Commit the transaction.
R1 - LDP
 
(config)#router ldp
Enter Router mode for LDP.
(config-router)#router-id 192.168.0.1
Set the router ID to IP address 192.168.0.1.
(config-router)#transport-address ipv4 192.168.0.1
Configure the transport address to be used for a TCP session over which LDP will run on an IPv4 interface. Note: It is preferable to use the loopback address as transport address. In addition, use the parameter “ipv6” if you are configuring an IPv6 interface.
(config-router)#targeted-peer ipv4 192.168.0.3
Configure targeted peer.
(config-router-targeted-peer)#exit
Exit-targeted-peer-mode.
(config-router)#exit
Exit the Router mode and return to the Configure mode.
(config)#interface xe1
Enter interface mode.
(config-if)#enable-ldp ipv4
Enable LDP on xe1.
(config-if)#commit
Commit the transaction.
R1 - OSPF
 
(config)#router ospf 100
Configure the routing process and specify the Process ID (100). The Process ID should be a unique positive integer identifying the routing process.
(config-router)#network 10.10.10.0/24 area 0
(config-router)#network 192.168.0.1/32 area 0
Define the interface on which OSPF runs and associate the area ID (0) with the interface.
(config-router)#commit
Commit the transaction.
R2 - NSM
 
#configure terminal
Enter configure mode.
(config)#interface lo
Specify the loopback (lo) interface to be configured.
(config-if)#ip address 192.168.0.2/32 secondary
Set the IP address of the loopback interface to 192.168.0.2/32.
(config-if)#exit
Exit interface mode.
(config)#interface xe1
Specify the interface (xe1) to be configured.
(config-if)#ip address 10.10.10.2/24
Assign IP address to interface
(config-if)#label-switching
Enable label switching on interface xe1.
(config-if)#exit
Exit interface mode.
(config)#interface xe2
Specify the interface (xe2) to be configured.
(config-if)#ip address 10.10.11.1/24
Assign IP address to interface.
(config-if)#label-switching
Enable label switching on interface xe2.
(config-if)#commit
Commit the transaction.
R2 - LDP
 
(config)#router ldp
Enter Router mode.
(config-router)#router-id 192.168.0.2
Set the router ID to IP address 192.168.0.2.
(config-router)#transport-address ipv4 192.168.0.2
Configure the transport address to be used for a TCP session over which LDP will run on an IPv4 interface. Note: It is preferable to use the loopback address as transport address. In addition, use the parameter “ipv6” if you are configuring an IPv6 interface.
(config-router)#exit
Exit Router mode and return to Configure mode.
(config)#interface xe1
Specify the interface (xe1) to be configured.
(config-if)#enable-ldp ipv4
Enable LDP on a specified interface (xe1).
(config-if)#exit
Exit interface mode.
(config)#interface xe2
Specify the interface (xe2) to be configured.
(config-if)#enable-ldp ipv4
Enable LDP on a specified interface (xe.
(config-if)#commit
Commit the transaction.
R2 - OSPF
 
(config)#router ospf 100
Configure the routing process and specify the Process ID (100). The Process ID should be a unique positive integer identifying the routing process.
(config-router)#network 10.10.10.0/24 area 0
(config-router)#network 10.10.11.0/24 area 0
(config-router)#network 192.168.0.2/32 area 0
Define the interfaces on which OSPF runs and associate the area ID (0) with them.
(config-router)#commit
Commit the transaction.
R3 - NSM
 
#configure terminal
Enter configure mode.
(config)#interface lo
Specify the loopback (lo) interface to be configured.
(config-if)#ip address 192.168.0.3/32 secondary
Set the IP address of the loopback interface to 192.168.0.3/32.
(config-if)#exit
Exit interface mode.
(config)#interface xe2
Specify the interface (xe2) to be configured.
(config-if)#ip address 10.10.11.1/24
Set the IP address of the interface to 10.10.11.1/24.
(config-if)#label-switching
Enable label switching on interface xe2.
(config-if)#commit
Commit the transaction.
R3 - LDP
 
(config)#router ldp
Enter Router mode.
(config-router)#router-id 192.168.0.3
Set the router ID for IP address 192.168.0.3.
(config-router)#transport-address ipv4 192.168.0.3
Configure the transport address to be used for a TCP session over which LDP will run on an IPv4 interface. Note: It is preferable to use the loopback address as transport address. In addition, use the parameter “ipv6” if you are configuring an IPv6 interface.
(config-router)#targeted-peer ipv4 192.168.0.1
Configure targeted peer.
(config-router-targeted-peer)#exit
Exit-targeted-peer-mode.
(config-router)#exit
Exit the Router mode and return to the Configure mode.
(config)#interface xe2
Enter interface mode.
(config-if)#enable-ldp ipv4
Enable LDP on xe2.
(config-if)#commit
Commit the transaction.
R3 - OSPF
 
(config)#router ospf 100
Configure the routing process and specify the Process ID (100). The Process ID should be a unique positive integer identifying the routing process.
(config-router)#network 10.10.11.0/24 area 0
(config-router)#network 192.168.0.3/32 area 0
Define the interfaces on which OSPF runs and associate the area ID (0) with them.
(config-router)#commit
Commit the transaction.
Validation
PE1
PE1#show ldp session
Peer IP Address IF Name My Role State KeepAlive UpTime
192.168.0.2 xe1 Passive OPERATIONAL 30 00:18:59
192.168.0.3 xe1 Passive OPERATIONAL 30 00:02:07
 
PE1#show ldp targeted-peer count
Num Targeted Peers: 1 [UP: 1]
 
PE1#show ldp session count
Multicast Peers : 2 [UP: 1]
Targeted Peers : 1 [UP: 0]
Total Sessions : 2 [UP: 1]
 
PE1#show ldp routes
Prefix Addr Nexthop Addr Intf Owner
10.10.10.0/24 0.0.0.0 xe1
10.10.11.0/24 10.10.10.2 xe1
192.168.0.1/32 0.0.0.0 lo
192.168.0.2/32 10.10.10.2 xe1
192.168.0.3/32 10.10.10.2 xe1
 
PE1#show ldp fec-ipv4 count
Num. IPv4 FEC(s): 5
P
P#show ldp session
Peer IP Address IF Name My Role State KeepAlive UpTime
192.168.0.1 xe1 Active OPERATIONAL 30 00:23:52
192.168.0.3 xe2 Passive OPERATIONAL 30 00:23:49
 
P#show ldp session count
Multicast Peers : 3 [UP: 2]
Targeted Peers : 0 [UP: 0]
Total Sessions : 2 [UP: 2]
 
P#show ldp routes
Prefix Addr Nexthop Addr Intf Owner
10.10.10.0/24 0.0.0.0 xe1 connected
10.10.11.0/24 0.0.0.0 xe2 connected
192.168.0.1/32 10.10.10.1 xe1 ospf
192.168.0.2/32 0.0.0.0 lo connected
192.168.0.3/32 10.10.11.2 xe2 ospf
PE2
PE2#show ldp session
Peer IP Address IF Name My Role State KeepAlive UpTime
192.168.0.2 xe2 Active OPERATIONAL 30 00:27:47
192.168.0.1 xe2 Active OPERATIONAL 30 00:10:58
 
PE2#show ldp session count
Multicast Peers : 2 [UP: 1] Targeted Peers : 1 [UP: 1]
Total Sessions : 2 [UP: 2]
 
OcNOS#show ldp targeted-peer count
Num Targeted Peers: 1 [UP: 1]
 
OcNOS#show ldp routes
Prefix Addr Nexthop Addr Intf Owner
10.10.10.0/24 10.10.11.1 xe2 ospf
10.10.11.0/24 0.0.0.0 xe2 connected
192.168.0.1/32 10.10.11.1 xe17 ospf
192.168.0.2/32 10.10.11.1 xe2 ospf
192.168.0.3/32 0.0.0.0 lo connected
 
PE2#show ldp fec
fec fec-ipv4
 
PE2#show ldp fec-ipv4 count
------------------------
Num. IPv4 FEC(s): 5
------------------------
Last modified date: 10/17/2023