Example for Configuring a Policy for Triggering Transit LSP Establishment
Networking Requirements
On an MPLS network shown in Figure 3-25, an LDP LSP is automatically established when MPLS LDP is enabled on interfaces of each LSR. On a large network, establishment of a large number of LSPs wastes resources. The number of established LSPs needs to be controlled to save system resources.
Configuration Roadmap
To meet the preceding requirements, configure a policy for triggering transit LSP establishment. The configuration roadmap is as follows:
As shown in Figure 3-25, only the FECs whose routes are 10.10.1.4/32 trigger the establishment of transit LSPs on LSRB. This reduces the number of LSPs and saves network resources.
Procedure
- Configure IP addresses for interfaces.
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
<Huawei> system-view [Huawei] sysname LSRA [LSRA] interface loopback 0 [LSRA-LoopBack0] ip address 10.10.1.1 32 [LSRA-LoopBack0] quit [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] ip address 10.1.1.1 24 [LSRA-GigabitEthernet1/0/0] quit
- Configure OSPF to advertise the network segments connecting
to interfaces on each node and to advertise the routes of hosts with
LSR IDs.
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
[LSRA] ospf 1 [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0 [LSRA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
- Configure basic MPLS and MPLS LDP functions on the nodes
and interfaces
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
[LSRA] mpls lsr-id 10.10.1.1 [LSRA] mpls [LSRA-mpls] quit [LSRA] mpls ldp [LSRA-mpls-ldp] quit [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] mpls [LSRA-GigabitEthernet1/0/0] mpls ldp [LSRA-GigabitEthernet1/0/0] quit
# Run the display mpls ldp lsp command on each node to view the establishment of the LDP LSPs. LSRA is used as an example.
[LSRA] display mpls ldp lsp LDP LSP Information ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 10.10.1.1/32 3/NULL 10.10.1.2 127.0.0.1 InLoop0 *10.10.1.1/32 Liberal/3 DS/10.10.1.2 10.10.1.2/32 NULL/3 - 10.1.1.2 GE1/0/0 10.10.1.2/32 1024/3 10.10.1.2 10.1.1.2 GE1/0/0 10.10.1.3/32 NULL/1025 - 10.1.1.2 GE1/0/0 10.10.1.3/32 1022/1025 10.10.1.2 10.1.1.2 GE1/0/0 10.10.1.4/32 NULL/4118 - 10.1.1.2 GE1/0/0 10.10.1.4/32 4105/4118 10.10.1.2 10.1.1.2 GE1/0/0 ------------------------------------------------------------------------------ TOTAL: 7 Normal LSP(s) Found. TOTAL: 1 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. A '*' before an LSP means the LSP is not established A '*' before a Label means the USCB or DSCB is stale A '*' before a UpstreamPeer means the session is state A '*' before a DS means the session is state A '*' before a NextHop means the LSP is FRR LSP
- Configure an IP prefix list on transit node LSRB to filter
out routes on transit node LSRB.
# Configure the IP prefix list on transit node LSRB to allow only 10.10.1.4/32 on LSRD to establish the transit LSP.
[LSRB]ip ip-prefix FilterOnTransit permit 10.10.1.4 32 [LSRB] mpls ldp [LSRB-mpls-ldp] propagate mapping for ip-prefix FilterOnTransit [LSRB-mpls-ldp] quit
- Verify the configuration.
# Run the display mpls ldp lsp command on each node to view the establishment of the LDP LSPs. LSRA is used as an example.
[LSRA] display mpls ldp lsp LDP LSP Information ------------------------------------------------------------------------------- DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface ------------------------------------------------------------------------------- 10.10.1.1/32 3/NULL 10.10.1.2 127.0.0.1 InLoop0 10.10.1.2/32 NULL/3 - 10.1.1.2 GE1/0/0 10.10.1.2/32 1024/3 10.10.1.2 10.1.1.2 GE1/0/0 10.10.1.4/32 NULL/4118 - 10.1.1.2 GE1/0/0 10.10.1.4/32 4105/4118 10.10.1.2 10.1.1.2 GE1/0/0 -------------------------------------------------------------------------- TOTAL: 5 Normal LSP(s) Found. TOTAL: 0 Liberal LSP(s) Found. TOTAL: 0 Frr LSP(s) Found. A '*' before an LSP means the LSP is not established A '*' before a Label means the USCB or DSCB is stale A '*' before a UpstreamPeer means the session is state A '*' before a DS means the session is state A '*' before a NextHop means the LSP is FRR LSP
The preceding command output shows that only the LDP LSP to the destination 10.10.1.2/32 and 10.10.1.4/32 that takes LSRA as the ingress node exists on each node, and other LDP LSPs that do not take LSRA as the ingress node exist on each node. This is because the IP prefix list is configured.
Configuration Files
LSRA configuration file
# sysname LSRA # mpls lsr-id 10.10.1.1 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.1 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
LSRB configuration file
# sysname LSRB # mpls lsr-id 10.10.1.2 mpls # mpls ldp propagate mapping for ip-prefix FilterOnTransit # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.2.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.2 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.1.0 0.0.0.255 # ip ip-prefix FilterOnTransit index 10 permit 10.10.1.4 32 # return
LSRC configuration file
# sysname LSRC # mpls lsr-id 10.10.1.3 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.2.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.3.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.3 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # return
LSRD configuration file
# sysname LSRD # mpls lsr-id 10.10.1.4 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.3.1.2 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 10.10.1.4 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.4 0.0.0.0 network 10.3.1.0 0.0.0.255 # return