Example for Configuring LDP over GRE
Networking Requirements
As shown in Figure 3-38, LSRA, LSRB, and LSRC belong to the VPN backbone network and IS-IS runs between them. GRE is used between LSRA and LSRC so that PC1 and PC2 can communicate. LSRB does not support MPLS. To provide services for L2VPN or L3VPN, an LDP LSP across a GRE tunnel needs to be established between LSRA and LSRC to implement LDP over GRE.
Configuration Roadmap
The configuration roadmap is as follows:
Configure interface IP addresses.
Configure an IGP protocol to advertise routes.
Configure basic MPLS functions.
Create tunnel interfaces on LSRA and LSRC and specify source and destination addresses of the tunnel.
Enable MPLS LDP on tunnel interfaces.
The IP address of Loopback0 interface is used as the LSR ID, that is, LDP uses this IP address to establish a session. A GRE tunnel interface must have an IP address configured, and uses addresses of Loopback1 interfaces as source and destination addresses. The source and destination addresses, and physical interface are advertised by an IGP, and the IP address of Loopback0 interface and tunnel interface address are advertised by another IGP or static route. If a static route is used, specify the tunnel interface as the outbound interface.
Procedure
- Configure IP addresses for interfaces.
# Assign an IP address to an interface on 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 gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] ip address 172.1.1.1 24 [LSRA-GigabitEthernet1/0/0] quit [LSRA] interface gigabitethernet 2/0/0 [LSRA-GigabitEthernet2/0/0] ip address 10.1.1.1 24 [LSRA-GigabitEthernet2/0/0] quit [LSRA] interface loopback 0 [LSRA-LoopBack0] ip address 1.1.1.9 32 [LSRA-LoopBack0] quit [LSRA] interface loopback 1 [LSRA-LoopBack1] ip address 11.11.11.11 32 [LSRA-LoopBack1] quit [LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] ip address 40.1.1.1 24 [LSRA-Tunnel0/0/1] quit
- Configure OSPF on LSRA and LSRC to advertise routes to
implement interworking on the MPLS network.
# Configure OSPF on LSRA to advertise routes.
[LSRA] ospf 1 [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255 [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] quit [LSRA-ospf-1] quit
# Configure OSPF on LSRC to advertise routes.
[LSRC] ospf 1 [LSRC-ospf-1] area 0 [LSRC-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255 [LSRC-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0 [LSRC-ospf-1-area-0.0.0.0] quit [LSRC-ospf-1] quit
- Configure IS-IS to advertise routes to ensure interworking
on the public network.
# Configure IS-IS on LSRA to advertise routes.
[LSRA] isis 1 [LSRA-isis-1] network-entity 10.0000.0000.0001.00 [LSRA-isis-1] quit [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] isis enable 1 [LSRA-GigabitEthernet1/0/0] quit [LSRA] interface loopback 1 [LSRA-LoopBack1] isis enable 1 [LSRA-LoopBack1] quit
# Configure IS-IS on LSRB to advertise routes.
[LSRB] isis 1 [LSRB-isis-1] network-entity 10.0000.0000.0002.00 [LSRB-isis-1] quit [LSRB] interface gigabitethernet 1/0/0 [LSRB-GigabitEthernet1/0/0] isis enable 1 [LSRB-GigabitEthernet1/0/0] quit [LSRB] interface gigabitethernet 2/0/0 [LSRB-GigabitEthernet2/0/0] isis enable 1 [LSRB-GigabitEthernet2/0/0] quit
# Configure IS-IS on LSRC to advertise routes.
[LSRC] isis 1 [LSRC-isis-1] network-entity 10.0000.0000.0003.00 [LSRC-isis-1] quit [LSRC] interface gigabitethernet 1/0/0 [LSRC-GigabitEthernet1/0/0] isis enable 1 [LSRC-GigabitEthernet1/0/0] quit [LSRC] interface loopback 1 [LSRC-LoopBack1] isis enable 1 [LSRC-LoopBack1] quit
- Enable MPLS and MPLS LDP on LSRA and LSRC.
# Enable MPLS and MPLS LDP on LSRA.
[LSRA] mpls lsr-id 1.1.1.9 [LSRA] mpls [LSRA-mpls] quit [LSRA] mpls ldp [LSRA-mpls-ldp] quit
# Enable MPLS and MPLS LDP on LSRC.
[LSRC] mpls lsr-id 3.3.3.9 [LSRC] mpls [LSRC-mpls] quit [LSRC] mpls ldp [LSRC-mpls-ldp] quit
- Create tunnel interfaces on LSRA and LSRC and specify source
and destination addresses of the tunnel.
# Configure source and destination addresses of the tunnel interface on LSRA.
[LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] tunnel-protocol gre [LSRA-Tunnel0/0/1] source loopback 1 [LSRA-Tunnel0/0/1] destination 33.33.33.33 [LSRA-Tunnel0/0/1] quit
# Configure source and destination addresses of the tunnel interface on LSRC.
[LSRC] interface tunnel 0/0/1 [LSRC-Tunnel0/0/1] tunnel-protocol gre [LSRC-Tunnel0/0/1] source loopback 1 [LSRC-Tunnel0/0/1] destination 11.11.11.11 [LSRC-Tunnel0/0/1] quit
- Enable MPLS and MPLS LDP on LSRA and LSRC.
# Enable MPLS and MPLS LDP on the tunnel interface of LSRA.
[LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] mpls [LSRA-Tunnel0/0/1] mpls ldp [LSRA-Tunnel0/0/1] quit
# Enable MPLS and MPLS LDP on the tunnel interface of LSRC.
[LSRC] interface tunnel 0/0/1 [LSRC-Tunnel0/0/1] mpls [LSRC-Tunnel0/0/1] mpls ldp [LSRC-Tunnel0/0/1] quit
- Verify the configuration.
# After the configurations are complete, run the display mpls lsp command. You can see that an LDP LSP with the outbound interface as Tunnel0/0/1 is established between LSRA and LSRC.
[LSRA] display mpls lsp include 3.3.3.9 32 ------------------------------------------------------------------------------- LSP Information: LDP LSP ------------------------------------------------------------------------------- FEC In/Out Label In/Out IF Vrf Name 3.3.3.9/32 NULL/3 -/Tun0/0/1 3.3.3.9/32 1024/3 -/Tun0/0/1
Configuration Files
LSRA configuration file
# sysname LSRA # mpls lsr-id 1.1.1.9 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0001.00 # interface GigabitEthernet1/0/0 ip address 172.1.1.1 255.255.255.0 isis enable 1 # interface GigabitEthernet2/0/0 ip address 10.1.1.1 255.255.255.0 # interface LoopBack0 ip address 1.1.1.9 255.255.255.255 # interface LoopBack1 ip address 11.11.11.11 255.255.255.255 isis enable 1 # interface Tunnel0/0/1 ip address 40.1.1.1 255.255.255.0 tunnel-protocol gre source LoopBack1 destination 33.33.33.33 mpls mpls ldp # ospf 1 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 40.1.1.0 0.0.0.255 # return
LSRB configuration file
# sysname LSRB # isis 1 network-entity 10.0000.0000.0002.00 # interface GigabitEthernet1/0/0 ip address 172.1.1.2 255.255.255.0 isis enable 1 # interface GigabitEthernet2/0/0 ip address 172.2.1.1 255.255.255.0 isis enable 1 # return
LSRC configuration file
# sysname LSRC # mpls lsr-id 3.3.3.9 mpls # mpls ldp # isis 1 network-entity 10.0000.0000.0003.00 # interface GigabitEthernet1/0/0 ip address 172.2.1.2 255.255.255.0 isis enable 1 # interface GigabitEthernet2/0/0 ip address 10.1.2.1 255.255.255.0 # interface LoopBack0 ip address 3.3.3.9 255.255.255.255 # interface LoopBack1 ip address 33.33.33.33 255.255.255.255 isis enable 1 # interface Tunnel0/0/1 ip address 40.1.1.2 255.255.255.0 tunnel-protocol gre source LoopBack1 destination 11.11.11.11 mpls mpls ldp # ospf 1 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 40.1.1.0 0.0.0.255 # return