Example for Configuring a Policy for Triggering LSP Establishment
Networking Requirements
As shown in Figure 3-24, 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 LSP establishment on the LSRA or LSRC. The configuration roadmap is as follows:
As shown in Figure 3-24, only the FECs whose routes are 10.10.1.3/32 trigger the establishment of LSPs on LSRA. This reduces the number of LSPs and saves network resources.
Procedure
- Configure IP addresses for interfaces.
# Configure LSRA. The configurations of LSRB and LSRC 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 and LSRC 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
After the configuration is complete, run the display ip routing-table command on each node, and you can view that the nodes learn routes from each other.
- Configure an LDP LSP.
# Configure LSRA. The configurations of LSRB and LSRC 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
After the configuration is complete, LSRs establish LSPs based on the host IP routes with the 32-bit addresses (default triggering policy).
# Run the display mpls ldp lsp command on the LSRs, and the command outputs show that all the host routes trigger the establishment of 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 ------------------------------------------------------------------------------ TOTAL: 5 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 stale A '*' before a DS means the session is stale A '*' before a NextHop means the LSP is FRR LSP
- Configure an IP prefix list based on the LSP establishment
control. Use this IP prefix list on LSRA to filter out LSP routes.
# Configure an IP prefix list on LSRA to allow only 10.10.1.3/32 on LSRC to establish LSPs.
[LSRA] ip ip-prefix FilterOnIngress permit 10.10.1.3 32 [LSRA] mpls [LSRA-mpls] lsp-trigger ip-prefix FilterOnIngress [LSRA-mpls] 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.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 ------------------------------------------------------------------------------ TOTAL: 3 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 stale A '*' before a DS means the session is stale 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.3/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 lsp-trigger ip-prefix FilterOnIngress # 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 # ip ip-prefix FilterOnIngress index 10 permit 10.10.1.3 32 # return
LSRB configuration file
# sysname LSRB # mpls lsr-id 10.10.1.2 mpls # mpls ldp # 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 # 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 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 # return