This section provides an example for configuring transit LSPs. The configuration procedure involves establishing local LDP sessions and configuring an IP prefix list to filter routes on each transit LSR.
After MPLS LDP is enabled on each interface, LDP LSPs can be automatically established, including a great number of unnecessary transit LSPs, which wastes resources. On the network shown in Figure 1, after a policy for triggering the establishment of transit LSPs is configured, LSRB only uses the routes to 4.4.4.4/32 to establish a transit LSP.
When configuring transit LSPs using a prefix list, note that LDP by default uses all eligible received routing information to establish transit LSPs.
The configuration roadmap is as follows:
Assign an IP address to each interface and configure OSPF to advertise the route to the network segment to which each interface is connected and the host route to each LSR ID.
Configure the IP prefix list to establish transit LSPs.
Enable MPLS and MPLS LDP globally on each LSR and configure a policy of triggering the establishment of LSPs.
Use the IP prefix list on transit LSRB to filter transit LSP routes.
Enable MPLS and MPLS LDP on each interface.
To complete the configuration, you need the following data:
IP address of each interface as shown in Figure 1, OSPF process ID, and OSPF area ID
Policy for triggering the LSP establishment
IP prefix list name and the routes to be filtered on the transit node
# According to Figure 1, assign an IP address to each interface, configure the loopback interface addresses as LSR IDs, and configure OSPF to advertise the route to the network segment to which each interface is connected and the host route to each LSR ID. For configuration details, see Configuration Files in this section.
# Configure the IP prefix list on transit LSRB to allow LSRB to only use routes to LSRD (4.4.4.4/32) to establish transit LSPs
[~LSRB]ip ip-prefix FilterOnTransit permit 4.4.4.4 32 [*LSRB]commit
# Configure LSRA.
[~LSRA] mpls lsr-id 1.1.1.1 [*LSRA] mpls [*LSRA-mpls] quit [*LSRA] mpls ldp [*LSRA-mpls-ldp] quit [*LSRA] interface gigabitethernet 0/1/0 [*LSRA-GigabitEthernet0/1/0] mpls [*LSRA-GigabitEthernet0/1/0] mpls ldp [*LSRA-GigabitEthernet0/1/0] commit [~LSRA-GigabitEthernet0/1/0] quit
# Configure LSRB.
[~LSRB] mpls lsr-id 2.2.2.2 [*LSRB] mpls [*LSRB-mpls] quit [*LSRB] mpls ldp [*LSRB-mpls-ldp] propagate mapping for ip-prefix FilterOnTransit [*LSRB-mpls-ldp] quit [*LSRB] interface gigabitethernet 0/1/0 [*LSRB-GigabitEthernet0/1/0] mpls [*LSRB-GigabitEthernet0/1/0] mpls ldp [*LSRB-GigabitEthernet0/1/0] quit [*LSRB] interface gigabitethernet 0/1/8 [*LSRB-GigabitEthernet0/1/8] mpls [*LSRB-GigabitEthernet0/1/8] mpls ldp [*LSRB-GigabitEthernet0/1/8] commit [~LSRB-GigabitEthernet0/1/8] quit
Repeat this step for LSRC and LSRD. For configuration details, see Configuration Files in this section.
Run the display mpls ldp lsp command to view the establishment of LSPs.
# Display LDP LSPs established on LSRA.
[~LSRA] display mpls ldp lsp LDP LSP Information ------------------------------------------------------------------------------- Flag after Out IF: (I) - RLFA Iterated LSP, (I*) - Normal and RLFA Iterated LSP ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 1.1.1.1/32 3/NULL 2.2.2.2 127.0.0.1 LoopBack1 2.2.2.2/32 NULL/3 - 192.168.1.2 GE0/1/0 2.2.2.2/32 1025/3 2.2.2.2 192.168.1.2 GE0/1/0 4.4.4.4/32 NULL/1025 - 192.168.1.2 GE0/1/0 4.4.4.4/32 1026/1026 4.4.4.4 192.168.1.2 GE0/1/0 192.168.1.0/24 3/NULL 2.2.2.2 192.168.1.1 GE0/1/0 *192.168.1.0/24 Liberal/26 DS/2.2.2.2 192.168.2.0/24 NULL/3 - 192.168.1.2 GE0/1/0 192.168.2.0/24 1027/3 3.3.3.3 192.168.1.2 GE0/1/0 -------------------------------------------------------------------------- TOTAL: 8 Normal LSP(s) Found. TOTAL: 1 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. An asterisk (*) before an LSP means the LSP is not established An asterisk (*) before a Label means the USCB or DSCB is stale An asterisk (*) before an UpstreamPeer means the session is stale An asterisk (*) before a DS means the session is stale An asterisk (*) before a NextHop means the LSP is FRR LSP
The command output shows that on each LSR, only LDP LSPs with transit LSRB and routes to 4.4.4.4/32 and other LDP LSPs, on which LSRB is not the transit node, have been established.
LSRA configuration file
#
sysname LSRA
#
mpls lsr-id 1.1.1.1
#
mpls
#
mpls ldp
#
ipv4-family
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 192.168.1.0 0.0.0.255
#
return
LSRB configuration file
# sysname LSRB # mpls lsr-id 2.2.2.2 # mpls # mpls ldp mpls ldp # ipv4-family propagate mapping for ip-prefix FilterOnTransit # interface GigabitEthernet0/1/0 undo shutdown ip address 192.168.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/1/8 undo shutdown ip address 192.168.2.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 2.2.2.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # ip ip-prefix FilterOnTransit index 10 permit 4.4.4.4 32 # return
LSRC configuration file
# sysname LSRC # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # ipv4-family # interface GigabitEthernet0/1/0 undo shutdown ip address 192.168.2.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/1/8 undo shutdown ip address 192.168.3.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 3.3.3.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.3.0 0.0.0.255 # return
LSRD configuration file
#
sysname LSRD
#
mpls lsr-id 4.4.4.4
#
mpls
#
mpls ldp
#
ipv4-family
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 192.168.3.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 4.4.4.4 255.255.255.255
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 192.168.3.0 0.0.0.255
#
Return