This section provides an example for configuring an outbound Label Distribution Protocol (LDP) policy that uses routes matching a specified IP prefix list to establish LDP label switched paths (LSPs).
An IP metro or bearer network uses the Layer 2 virtual private network (L2VPN) or Layer 3 VPN (L3VPN) technique to transmit high-speed Internet (HSI) or Voice over Internet Protocol (VoIP) services over end-to-end (E2E) public network LDP LSPs. Digital subscriber line access multiplexers (DSLAMs) that have low performance are overloaded if a great number of LDP LSPs are established. An outbound LDP policy can be configured to minimize LDP LSPs to be established, reduce DSLAM memory consumption, and relieve the burden on the DSLAMs.
The configuration roadmap is as follows:
Assign an IP address and a loopback address to each interface.
Configure Open Shortest Path First (OSPF) to advertise the route to each network segment to which each interface is connected and to advertise the host route to each loopback interface address that is a label switching router (LSR) ID.
Enable Multiprotocol Label Switching (MPLS) and MPLS LDP globally on each LSR.
Configure an outbound LDP policy on LSRA to send LSRD (functioning as a DSLAM) Label Mapping messages carrying routes only to LSRC. This allows LSRD to establish LSPs only to LSRC, which reduces memory consumption.
Configure MPLS and MPLS LDP on each interface.
Assign an IP address and its mask to each physical interface, configure a loopback interface address as an LSR ID on every LSR shown in Figure 1, and configure OSPF to advertise the route to the network segment to which each interface is connected and to advertise a host route to each loopback interface address (LSR ID). For configuration details, see Configuration Files in this section.
# Configure LSRA.
<LSRA> system-view [~LSRA] mpls lsr-id 3.3.3.9 [*LSRA] mpls [*LSRA-mpls] quit [*LSRA] mpls ldp [*LSRA-mpls-ldp] commit [~LSRA-mpls-ldp] quit
# Configure LSRB.
<LSRB> system-view [~LSRB] mpls lsr-id 2.2.2.9 [*LSRB] mpls [*LSRB-mpls] quit [*LSRB] mpls ldp [*LSRB-mpls-ldp] commit [~LSRB-mpls-ldp] quit
# Configure LSRC.
<LSRC> system-view [~LSRC] mpls lsr-id 1.1.1.9 [*LSRC] mpls [*LSRC-mpls] quit [*LSRC] mpls ldp [*LSRC-mpls-ldp] commit [~LSRC-mpls-ldp] quit
# Configure LSRD that is a DSLAM.
<DSLAM> system-view [~DSLAM] mpls lsr-id 4.4.4.9 [*DSLAM] mpls [*DSLAM-mpls] quit [*DSLAM] mpls ldp [*DSLAM-mpls-ldp] commit [~DSLAM-mpls-ldp] quit
# Configure an IP prefix list on LSRA to permit the routes only to LSRC to pass the outbound LDP policy.
[~LSRA] ip ip-prefix prefix1 permit 1.1.1.9 32
# Configure an outbound policy on LSRA to send LSRD Label Mapping messages carrying the routes only to LSRC.
[*LSRA] mpls ldp [*LSRA-mpls-ldp] ipv4-family [*LSRA-mpls-ldp-ipv4] outbound peer 4.4.4.9 fec ip-prefix prefix1 [*LSRA-mpls-ldp-ipv4] commit [~LSRA-mpls-ldp-ipv4] quit [~LSRA-mpls-ldp] quit
# Configure LSRA.
<LSRA> system-view [~LSRA] interface gigabitethernet0/1/1 [~LSRA-GigabitEthernet0/1/1] mpls [*LSRA-GigabitEthernet0/1/1] mpls ldp [*LSRA-GigabitEthernet0/1/1] commit [~LSRA-GigabitEthernet0/1/1] quit [~LSRA] interface gigabitethernet0/1/3 [~LSRA-GigabitEthernet0/1/3] mpls [*LSRA-GigabitEthernet0/1/3] mpls ldp [*LSRA-GigabitEthernet0/1/3] commit [~LSRA-GigabitEthernet0/1/3] quit
# Configure LSRB.
<LSRB> system-view [~LSRB] interface gigabitethernet0/1/1 [~LSRB-GigabitEthernet0/1/1] mpls [*LSRB-GigabitEthernet0/1/1] mpls ldp [*LSRB-GigabitEthernet0/1/1] quit [*LSRB] interface gigabitethernet0/1/3 [*LSRB-GigabitEthernet0/1/3] mpls [*LSRB-GigabitEthernet0/1/3] mpls ldp [*LSRB-GigabitEthernet0/1/3] commit [~LSRB-GigabitEthernet0/1/3] quit
# Configure LSRC.
<LSRC> system-view [~LSRC] interface gigabitethernet0/1/1 [~LSRC-GigabitEthernet0/1/1] mpls [*LSRC-GigabitEthernet0/1/1] mpls ldp [*LSRC-GigabitEthernet0/1/1] commit [~LSRC-GigabitEthernet0/1/1] quit
# Configure the DSLAM.
<DSLAM> system-view [~DSLAM] interface gigabitethernet1/0/1 [~DSLAM-GigabitEthernet1/0/1] mpls [*DSLAM-GigabitEthernet1/0/1] mpls ldp [*DSLAM-GigabitEthernet1/0/1] commit [~DSLAM-GigabitEthernet1/0/1] quit
After completing the preceding configurations, run the display mpls ldp lsp command on LSRD functioning as a DSLAM. The command output shows that a single LSP to LSRC has been established.
[~DSLAM] 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.9/32 NULL/1025 - 10.1.3.1 GE0/1/1 1.1.1.9/32 1024/1025 3.3.3.9 10.1.3.1 GE0/1/1 4.4.4.9/32 3/NULL 3.3.3.9 127.0.0.1 LoopBack0 ------------------------------------------------------------------------------- TOTAL: 3 Normal LSP(s) Found. TOTAL: 0 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
If no outbound LDP policy is configured on LSRA, the following command output is displayed on LSRD.
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.9/32 NULL/1025 - 10.1.3.1 GE0/1/1 1.1.1.9/32 1024/1025 3.3.3.9 10.1.3.1 GE0/1/1 2.2.2.9/32 NULL/1024 - 10.1.3.1 GE0/1/1 2.2.2.9/32 1027/1024 3.3.3.9 10.1.3.1 GE0/1/1 3.3.3.9/32 NULL/3 - 10.1.3.1 GE0/1/1 3.3.3.9/32 1028/3 3.3.3.9 10.1.3.1 GE0/1/1 4.4.4.9/32 3/NULL 3.3.3.9 127.0.0.1 LoopBack0 *4.4.4.9/32 Liberal/1026 DS/3.3.3.9 ------------------------------------------------------------------------------- TOTAL: 7 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
LSRA configuration file
# sysname LSRA # mpls lsr-id 3.3.3.9 # mpls # mpls ldp # ipv4-family outbound peer 4.4.4.9 fec ip-prefix prefix1 # interface GigabitEthernet0/1/1 undo shutdown ip address 10.1.2.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/1/3 undo shutdown ip address 10.1.3.1 255.255.255.0 mpls mpls ldp # 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.1.2.0 0.0.0.255 network 10.1.3.0 0.0.0.255 # ip ip-prefix prefix1 index 10 permit 1.1.1.9 32 # return
LSRB configuration file
# sysname LSRB # mpls lsr-id 2.2.2.9 # mpls # mpls ldp # ipv4-family # interface GigabitEthernet0/1/1 undo shutdown ip address 10.1.2.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/1/3 undo shutdown ip address 10.1.1.2 255.255.255.0 mpls mpls ldp # 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.1.2.0 0.0.0.255 # return
LSRC configuration file
#
sysname LSRC
#
mpls lsr-id 1.1.1.9
#
mpls
#
mpls ldp
#
ipv4-family
#
interface GigabitEthernet0/1/1
undo shutdown
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
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
DSLAM configuration file
#
sysname DSLAM
#
mpls lsr-id 4.4.4.9
#
mpls
#
mpls ldp
#
ipv4-family
#
interface GigabitEthernet0/1/1
undo shutdown
ip address 10.1.3.2 255.255.255.0
mpls
mpls ldp
#
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.1.3.0 0.0.0.255
#
return