Example for Configuring Local LDP Sessions
Networking Requirements
As shown in Figure 3-21, LSRA and LSRC are PEs of the IP/MPLS backbone network. MPLS L2VPN or L3VPN services need to be deployed on LSRA and LSRC to connect VPN sites, so local LDP sessions need to be established between LSRs to trigger LDP LSP setup. The LDP LSPs then transmit VPN services.
Configuration Roadmap
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 public tunnels can be set up to transmit VPN services.
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.
[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 LSRB.
[LSRB] ospf 1 [LSRB-ospf-1] area 0 [LSRB-ospf-1-area-0.0.0.0] network 10.10.1.2 0.0.0.0 [LSRB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [LSRB-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [LSRB-ospf-1-area-0.0.0.0] quit [LSRB-ospf-1] quit
# Configure LSRC.
[LSRC] ospf 1 [LSRC-ospf-1] area 0 [LSRC-ospf-1-area-0.0.0.0] network 10.10.1.3 0.0.0.0 [LSRC-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255 [LSRC-ospf-1-area-0.0.0.0] quit [LSRC-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.
- Enable global MPLS and MPLS LDP on each LSR.
# Configure LSRA.
[LSRA] mpls lsr-id 10.10.1.1 [LSRA] mpls [LSRA-mpls] quit [LSRA] mpls ldp [LSRA-mpls-ldp] quit
# Configure LSRB.
[LSRB] mpls lsr-id 10.10.1.2 [LSRB] mpls [LSRB-mpls] quit [LSRB] mpls ldp [LSRB-mpls-ldp] quit
# Configure LSRC.
[LSRC] mpls lsr-id 10.10.1.3 [LSRC] mpls [LSRC-mpls] quit [LSRC] mpls ldp [LSRC-mpls-ldp] quit
- Enable MPLS and MPLS LDP on interfaces of each LSR.
# Configure LSRA.
[LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] mpls [LSRA-GigabitEthernet1/0/0] mpls ldp [LSRA-GigabitEthernet1/0/0] quit
# Configure LSRB.
[LSRB] interface gigabitethernet 1/0/0 [LSRB-GigabitEthernet1/0/0] mpls [LSRB-GigabitEthernet1/0/0] mpls ldp [LSRB-GigabitEthernet1/0/0] quit [LSRB] interface gigabitethernet 2/0/0 [LSRB-GigabitEthernet2/0/0] mpls [LSRB-GigabitEthernet2/0/0] mpls ldp [LSRB-GigabitEthernet2/0/0] quit
# Configure LSRC.
[LSRC] interface gigabitethernet 1/0/0 [LSRC-GigabitEthernet1/0/0] mpls [LSRC-GigabitEthernet1/0/0] mpls ldp [LSRC-GigabitEthernet1/0/0] quit
- Verify the configuration.
# After the configuration is complete, run the display mpls ldp session command. The command output shows that the status of local LDP sessions between LSRA and LSRB and between LSRB and LSRC is Operational.
LSRA is used as an example.
[LSRA] display mpls ldp session LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) A '*' before a session means the session is being deleted. ------------------------------------------------------------------------------ PeerID Status LAM SsnRole SsnAge KASent/Rcv ------------------------------------------------------------------------------ 10.10.1.2:0 Operational DU Passive 0000:00:22 91/91 ------------------------------------------------------------------------------ TOTAL: 1 session(s) Found.
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 # 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