As shown in Figure 1, LSRA and LSRD are edge devices of the MPLS backbone network and have low performance. After MPLS LDP is enabled on each LSR interface, LDP LSPs are set up automatically. Because the network scale is large (this example provides two devices on intermediate nodes), many unnecessary LSPs are set up, wasting resources. The number of LSPs established on edge devices needs to be reduced so that the burden of edge devices is reduced.
Policies cannot be configured on edge devices.
You can configure a policy for triggering LDP LSP setup to meet the requirement. The configuration roadmap is as follows:
Configure OSPF between the LSRs to implement IP connectivity on the backbone network.
Configure local LDP sessions on LSRs so that LDP LSPs can be set up.
Configure a policy for triggering LDP LSP setup on LSRB and LSRC to reduce the number of LSPs on edge devices so that the burden of edge devices is reduced.
# 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 1.1.1.9 32 [LSRA-LoopBack0] quit [LSRA] vlan batch 10 [LSRA] interface vlanif 10 [LSRA-Vlanif10] ip address 10.1.1.1 24 [LSRA-Vlanif10] quit [LSRA] interface gigabitethernet 0/0/1 [LSRA-GigabitEthernet0/0/1] port link-type trunk [LSRA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [LSRA-GigabitEthernet0/0/1] quit
# 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 1.1.1.9 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 LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
[LSRA] mpls lsr-id 1.1.1.9 [LSRA] mpls [LSRA-mpls] quit [LSRA] mpls ldp [LSRA-mpls-ldp] quit [LSRA] interface vlanif 10 [LSRA-Vlanif10] mpls [LSRA-Vlanif10] mpls ldp [LSRA-Vlanif10] 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
-------------------------------------------------------------------------------
Flag after Out IF: (I) - LSP Is Only Iterated by RLFA
-------------------------------------------------------------------------------
DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
-------------------------------------------------------------------------------
1.1.1.9/32 3/NULL 2.2.2.9 127.0.0.1 InLoop0
*1.1.1.9/32 Liberal/3 DS/2.2.2.9
2.2.2.9/32 NULL/3 - 10.1.1.2 Vlanif10
2.2.2.9/32 1024/3 2.2.2.9 10.1.1.2 Vlanif10
3.3.3.9/32 NULL/1025 - 10.1.1.2 Vlanif10
3.3.3.9/32 1022/1025 2.2.2.9 10.1.1.2 Vlanif10
4.4.4.9/32 NULL/4118 - 10.1.1.2 Vlanif10
4.4.4.9/32 4105/4118 2.2.2.9 10.1.1.2 Vlanif10
-------------------------------------------------------------------------------
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 stale
A '*' before a DS means the session is stale
A '*' before a NextHop means the LSP is FRR LSP
# Configure the IP prefix list on transit node LSRB to allow only 1.1.1.9/32 and 4.4.4.9/32 for LSP setup.
[LSRB] ip ip-prefix FilterOnTransit permit 1.1.1.9 32 [LSRB] ip ip-prefix FilterOnTransit permit 4.4.4.9 32 [LSRB] mpls ldp [LSRB-mpls-ldp] propagate mapping for ip-prefix FilterOnTransit [LSRB-mpls-ldp] quit
# Configure the IP prefix list on transit node LSRC to allow only 1.1.1.9/32 and 4.4.4.9/32 for LSP setup.
[LSRC] ip ip-prefix FilterOnTransit permit 1.1.1.9 32 [LSRC] ip ip-prefix FilterOnTransit permit 4.4.4.9 32 [LSRC] mpls ldp [LSRC-mpls-ldp] propagate mapping for ip-prefix FilterOnTransit [LSRC-mpls-ldp] quit
# After the configuration is complete, run the display mpls ldp lsp command on LSRA and LSRD to view LDP LSP establishment.
[LSRA] display mpls ldp lsp
LDP LSP Information
-------------------------------------------------------------------------------
Flag after Out IF: (I) - LSP Is Only Iterated by RLFA
-------------------------------------------------------------------------------
DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
-------------------------------------------------------------------------------
1.1.1.9/32 3/NULL 2.2.2.9 127.0.0.1 InLoop0
*1.1.1.9/32 Liberal/3 DS/2.2.2.9
2.2.2.9/32 NULL/3 - 10.1.1.2 Vlanif10
2.2.2.9/32 1024/3 2.2.2.9 10.1.1.2 Vlanif10
4.4.4.9/32 NULL/4118 - 10.1.1.2 Vlanif10
4.4.4.9/32 4105/4118 2.2.2.9 10.1.1.2 Vlanif10
-------------------------------------------------------------------------------
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
Because the policy for triggering LDP LSP setup is configured on LSRB, the LDP LSP destined for 3.3.3.9/32 is filtered on LSRA.
[LSRD] display mpls ldp lsp
LDP LSP Information
-------------------------------------------------------------------------------
Flag after Out IF: (I) - LSP Is Only Iterated by RLFA
-------------------------------------------------------------------------------
DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
-------------------------------------------------------------------------------
1.1.1.9/32 NULL/4110 - 10.3.1.1 Vlanif30
1.1.1.9/32 4100/4110 3.3.3.9 10.3.1.1 Vlanif30
3.3.3.9/32 NULL/3 - 10.3.1.1 Vlanif30
3.3.3.9/32 1026/3 3.3.3.9 10.3.1.1 Vlanif30
4.4.4.9/32 3/NULL 3.3.3.9 127.0.0.1 InLoop0
*4.4.4.9/32 Liberal/3 DS/3.3.3.9
-------------------------------------------------------------------------------
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
Because the policy for triggering LDP LSP setup is configured on LSRC, the LDP LSP destined for 2.2.2.9/32 is filtered on LSRD.
LSRA configuration file
# sysname LSRA # vlan batch 10 # mpls lsr-id 1.1.1.9 mpls # mpls ldp # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface LoopBack0 ip address 1.1.1.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 10.1.1.0 0.0.0.255 # return
LSRB configuration file
# sysname LSRB # vlan batch 10 20 # mpls lsr-id 2.2.2.9 mpls # mpls ldp propagate mapping for ip-prefix FilterOnTransit # interface Vlanif10 ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # interface Vlanif20 ip address 10.2.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 20 # interface LoopBack0 ip address 2.2.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.9 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 1.1.1.9 32 ip ip-prefix FilterOnTransit index 20 permit 4.4.4.9 32 # return
LSRC configuration file
# sysname LSRC # vlan batch 20 30 # mpls lsr-id 3.3.3.9 mpls # mpls ldp propagate mapping for ip-prefix FilterOnTransit # interface Vlanif20 ip address 10.2.1.2 255.255.255.0 mpls mpls ldp # interface Vlanif30 ip address 10.3.1.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 30 # interface LoopBack0 ip address 3.3.3.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # ip ip-prefix FilterOnTransit index 10 permit 1.1.1.9 32 ip ip-prefix FilterOnTransit index 20 permit 4.4.4.9 32 # return
LSRD configuration file
# sysname LSRD # vlan batch 30 # mpls lsr-id 4.4.4.9 mpls # mpls ldp # interface Vlanif30 ip address 10.3.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 30 # interface LoopBack0 ip address 4.4.4.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 4.4.4.9 0.0.0.0 network 10.3.1.0 0.0.0.255 # return