An MPLS TE tunnel does not automatically direct traffic. To direct traffic to an MPLS TE tunnel, configure Interior Gateway Protocol (IGP) shortcut. IGP shortcut enables a device to use a TE tunnel as a logical link for IGP route calculation. You can set a proper metric for an MPLS TE tunnel to ensure that the route passing through the MPLS TE tunnel is preferred, allowing traffic to be directed to the MPLS TE tunnel.
As shown in Figure 1, devices use OSPF to communicate with each other. An MPLS TE tunnel is established from LSRA and LSRC. The MPLS TE tunnel passes through LSRB. The number marked on each link indicates the link cost. If LSRA has traffic destined for LSRE and LSRC, LSRA sends the traffic to GE0/0/2 based on the OSPF route selection result. If the link between LSRA and LSRD has 100 Mbit/s of bandwidth and LSRA requires 50 Mbit/s bandwidth to send traffic to LSRC and 60 Mbit/s bandwidth to send traffic to LSRE, the link between LSRA and LSRB is congested. Congestion on the link causes traffic transmission delay or packet loss.
To resolve this problem, configure IGP shortcut on the tunnel interface of LSRA to direct traffic destined for LSRC to the MPLS TE tunnel. By doing this, traffic is forwarded by GE0/0/1 and network congestion is prevented.
After IGP shortcut is configured on the tunnel interface of LSRA, LSRA does not advertise the MPLS TE tunnel to its peers as a route. The MPLS TE tunnel is used only for local route calculation.
In this scenario, to avoid loops, ensure that all connected interfaces have STP disabled and connected interfaces are removed from VLAN 1. If STP is enabled and VLANIF interfaces of switches are used to construct a Layer 3 ring network, an interface on the network will be blocked. As a result, Layer 3 services on the network cannot run normally.
The configuration roadmap is as follows:
Assign an IP address to each interface, configure OSPF to ensure that there are reachable routes between LSRs, and configure the OSPF cost.
On LSRA, create an MPLS TE tunnel over the path LSRA -> LSRB -> LSRC. This example uses RSVP-TE to establish a dynamic MPLS TE tunnel. Configure an ID for each LSR, enable MPLS TE, RSVP-TE, and CSPF on each node and interface, and enable OSPF TE. On the ingress node of the primary tunnel, create a tunnel interface, and specify the IP address, tunneling protocol, destination IP address, tunnel ID, and dynamic signaling protocol RSVP-TE for the tunnel interface.
Enable IGP shortcut on the TE tunnel interface of LSRA and configure an IGP metric for the TE tunnel.
# Configure LSRA. Configure IP addresses for interfaces of LSRB, LSRC, LSRD, and LSRE according to Figure 1. The configurations on LSRB, LSRC, LSRD, and LSRE are similar to the configuration of LSRA, and are not mentioned here.
<HUAWEI> system-view [HUAWEI] sysname LSRA [LSRA] vlan batch 100 400 [LSRA] interface vlanif 100 [LSRA-Vlanif100] ip address 172.1.1.1 255.255.255.0 [LSRA-Vlanif100] ospf cost 15 [LSRA-Vlanif100] quit [LSRA] interface vlanif 400 [LSRA-Vlanif400] ip address 172.4.1.1 255.255.255.0 [LSRA-Vlanif400] ospf cost 10 [LSRA-Vlanif400] quit [LSRA] interface gigabitethernet 0/0/1 [LSRA-GigabitEthernet0/0/1] port link-type trunk [LSRA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [LSRA-GigabitEthernet0/0/1] quit [LSRA] interface gigabitethernet 0/0/2 [LSRA-GigabitEthernet0/0/2] port link-type trunk [LSRA-GigabitEthernet0/0/2] port trunk allow-pass vlan 400 [LSRA-GigabitEthernet0/0/2] quit [LSRA] interface loopback 1 [LSRA-LoopBack1] ip address 1.1.1.9 255.255.255.255 [LSRA-LoopBack1] quit [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 172.1.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] network 172.4.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
After the configurations are complete, run the display ip routing-table command on LSRA, LSRB, and LSRC. You can see that PE1 and PE2 have learned the routes to Loopback1 of each other.
To set up a TE tunnel from LSRA to LSRC, perform the following configurations on LSRA, LSRB, and LSRC.
# Configure LSRA. The configurations on LSRB and LSRC are similar to the configuration of LSRA, and are not mentioned here. CSPF only needs to be configured on the ingress node of the primary tunnel.
[LSRA] mpls lsr-id 1.1.1.9 [LSRA] mpls [LSRA-mpls] mpls te [LSRA-mpls] mpls rsvp-te [LSRA-mpls] mpls te cspf [LSRA-mpls] quit [LSRA] interface vlanif 100 [LSRA-Vlanif100] mpls [LSRA-Vlanif100] mpls te [LSRA-Vlanif100] mpls rsvp-te [LSRA-Vlanif100] quit
To set up a TE tunnel from LSRA to LSRC, perform the following configurations on LSRA, LSRB, and LSRC.
# Configure LSRA. The configurations on LSRB and LSRC are similar to the configuration of LSRA, and are not mentioned here.
[LSRA] ospf [LSRA-ospf-1] opaque-capability enable [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] mpls-te enable [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
# Specify an explicit path for a TE tunnel.
[LSRA] explicit-path pri-path [LSRA-explicit-path-pri-path] next hop 172.1.1.2 [LSRA-explicit-path-pri-path] next hop 172.2.1.2 [LSRA-explicit-path-pri-path] next hop 3.3.3.9 [LSRA-explicit-path-pri-path] quit
# Create a tunnel interface on LSRA.
[LSRA] interface tunnel 1 [LSRA-Tunnel1] ip address unnumbered interface loopback 1 [LSRA-Tunnel1] tunnel-protocol mpls te [LSRA-Tunnel1] destination 3.3.3.9 [LSRA-Tunnel1] mpls te tunnel-id 100 [LSRA-Tunnel1] mpls te path explicit-path pri-path [LSRA-Tunnel1] mpls te commit [LSRA-Tunnel1] quit
Enable IGP shortcut on the TE tunnel interface of LSRA and set the IGP metric to 10 for the TE tunnel.
# Configure LSRA.
[LSRA] interface tunnel 1 [LSRA-Tunnel1] mpls te igp shortcut ospf [LSRA-Tunnel1] mpls te igp metric absolute 10 [LSRA-Tunnel1] mpls te commit [LSRA-Tunnel1] quit [LSRA] ospf 1 [LSRA-ospf-1] enable traffic-adjustment [LSRA-ospf-1] quit
After the configurations are complete, run the display ip routing-table 3.3.3.9 command on LSRA. You can see that the next hop address of the route destined for LSRC (3.3.3.9) is 1.1.1.9 and the outbound interface of this route is Tunnel1. The traffic destined for LSRC has been directed to the MPLS TE tunnel.
[LSRA] display ip routing-table 3.3.3.9 Route Flags: R - relay, D - download to fib, T - to vpn-instance ------------------------------------------------------------------------------ Routing Table : Public Summary Count : 1 Destination/Mask Proto Pre Cost Flags NextHop Interface 3.3.3.9/32 OSPF 10 10 D 1.1.1.9 Tunnel1
LSRA configuration file
# sysname LSRA # vlan batch 100 400 # mpls lsr-id 1.1.1.9 mpls mpls te mpls rsvp-te mpls te cspf # explicit-path pri-path next hop 172.1.1.2 next hop 172.2.1.2 next hop 3.3.3.9 # interface Vlanif100 ip address 172.1.1.1 255.255.255.0 ospf cost 15 mpls mpls te mpls rsvp-te # interface Vlanif400 ip address 172.4.1.1 255.255.255.0 ospf cost 10 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 400 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te tunnel-id 100 mpls te path explicit-path pri-path mpls te igp shortcut ospf mpls te igp metric absolute 10 mpls te commit # ospf 1 opaque-capability enable enable traffic-adjustment area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 mpls-te enable # return
LSRB configuration file
# sysname LSRB # vlan batch 100 200 # mpls lsr-id 2.2.2.9 mpls mpls te mpls rsvp-te # interface Vlanif100 ip address 172.1.1.2 255.255.255.0 ospf cost 15 mpls mpls te mpls rsvp-te # interface Vlanif200 ip address 172.2.1.1 255.255.255.0 ospf cost 10 mpls mpls te mpls rsvp-te # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.2.1.0 0.0.0.255 mpls-te enable # return
LSRC configuration file
# sysname LSRC # vlan batch 200 300 # mpls lsr-id 3.3.3.9 mpls mpls te mpls rsvp-te # interface Vlanif200 ip address 172.2.1.2 255.255.255.0 ospf cost 10 mpls mpls te mpls rsvp-te # interface Vlanif300 ip address 172.3.1.1 255.255.255.0 ospf cost 10 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 200 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 300 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 172.2.1.0 0.0.0.255 network 172.3.1.0 0.0.0.255 mpls-te enable # return
LSRD configuration file
# sysname LSRD # vlan batch 300 400 500 # interface Vlanif300 ip address 172.3.1.2 255.255.255.0 ospf cost 10 # interface Vlanif400 ip address 172.4.1.2 255.255.255.0 ospf cost 10 # interface Vlanif500 ip address 172.5.1.1 255.255.255.0 ospf cost 10 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 300 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 400 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 500 # ospf 1 area 0.0.0.0 network 172.3.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 network 172.5.1.0 0.0.0.255 # return
LSRE configuration file
#
sysname LSRE
#
vlan batch 500
#
interface Vlanif500
ip address 172.5.1.2 255.255.255.0
ospf cost 10
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 500
#
ospf 1
area 0.0.0.0
network 172.5.1.0 0.0.0.255
#
return