This article shows how to simply create traffic engineering tunnels using both dynamic and static tunnel paths.It also shows how to steer traffic over the tunnel.
We will create a network consisting of four routers connected in diamond shape as illustrated in diagram below.
Each router is connected to neighboring router using /30 network and each of them have unique loopback address form 10.255.0.x network. Loopback addresses will be used as tunnel source and destination.
The goal is to interconnect two LAN segments (Lan1, Lan2) using TE tunnels in the way that:
- traffic in direction from LAN1 to LAN2 goes over path through R2
- traffic in direction from LAN2 to LAN1 goes over path through R4
Connectivity between routers and Loopback addresses
/system identity set name=R1 /interface bridge add name=Loopback /ip address add address=192.168.33.1/30 interface=ether1 add address=192.168.33.14/30 interface=ether2 add address=192.168.10.1/24 interface=ether3 add address=10.255.0.1/32 interface=Loopback
/system identity set name=R2 /interface bridge add name=Loopback /ip address add address=192.168.33.2/30 interface=ether1 add address=192.168.33.5/30 interface=ether2 add address=10.255.0.2/32 interface=Loopback
/system identity set name=R3 /interface bridge add name=Loopback /ip address add address=192.168.33.6/30 interface=ether1 add address=192.168.33.9/30 interface=ether2 add address=192.168.20.1/24 interface=ether3 add address=10.255.0.3/32 interface=Loopback
/system identity set name=R4 /interface bridge add name=Loopback /ip address add address=192.168.33.10/30 interface=ether1 add address=192.168.33.13/30 interface=ether2 add address=10.255.0.4/32 interface=Loopback
Loopback address reachability and CSPF setup
In this setup we will use OSPF dynamic routing protocol to distribute routing information between routers. To successfully complete the setup we need loopback reachability information on every router.
CSPF will also be configured (extension of OSPF) to carry TE reservation information.
/routing ospf instance set default router-id=10.255.0.1 mpls-te-area=backbone mpls-te-router-id=Loopback /routing ospf network add network=192.168.33.0/24 area=backbone add network=10.255.0.1/32 area=backbone
/routing ospf instance set default router-id=10.255.0.2 mpls-te-area=backbone mpls-te-router-id=Loopback /routing ospf network add network=192.168.33.0/24 area=backbone add network=10.255.0.2/32 area=backbone
/routing ospf instance set default router-id=10.255.0.3 mpls-te-area=backbone mpls-te-router-id=Loopback /routing ospf network add network=192.168.33.0/24 area=backbone add network=10.255.0.3/32 area=backbone
/routing ospf instance set default router-id=10.255.0.4 mpls-te-area=backbone mpls-te-router-id=Loopback /routing ospf network add network=192.168.33.0/24 area=backbone add network=10.255.0.4/32 area=backbone
After OSPF is set up verify that we have correct routing information in routing table of each router:
[admin@R1] /ip route> print Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit # DST-ADDRESS PREF-SRC GATEWAY DISTANCE 0 ADS 0.0.0.0/0 10.5.101.1 1 1 ADC 10.255.0.1/32 10.255.0.1 lo 0 2 ADo 10.255.0.2/32 192.168.33.2 110 3 ADo 10.255.0.3/32 192.168.33.2 110 192.168.33.13 4 ADo 10.255.0.4/32 192.168.33.13 110 5 ADC 192.168.10.0/30 192.168.10.1 ether3 0 6 ADC 192.168.33.0/30 192.168.33.1 ether1 0 7 ADo 192.168.33.4/30 192.168.33.2 110 8 ADo 192.168.33.8/30 192.168.33.13 110 9 ADC 192.168.33.12/30 192.168.33.14 ether2 0
Setting Resource Reservation
Next step is to set up TE resource for every interface on which we might want to run TE tunnel.
Configuration on all the routers are the same:
/mpls traffic-eng interface add interface=ether1 bandwidth=10Mbps add interface=ether2 bandwidth=10Mbps
Since we are not using real bandwidth limitation on the tunnels in this example, bandwidth parameter is only used for administrative purposes and can be any value (it does not represent how much bandwidth will actually flow through the interface).
TE tunnel setup
Since our primary goal is to strictly forward traffic over specific path we will use static path configuration as primary, and dynamic (CSPF) as secondary path if primary fails.
/mpls traffic-eng tunnel-path add name=dyn use-cspf=yes add name=tun-first-link use-cspf=no \ hops=192.168.33.2:strict,192.168.33.5:strict,192.168.33.6:strict /interface traffic-eng add bandwidth=5Mbps name=TE-to-R3 to-address=10.255.0.3 primary-path=tun-first-link \ secondary-paths=dyn record-route=yes from-address=10.255.0.1
/mpls traffic-eng tunnel-path add name=dyn use-cspf=yes add name=tun-second-link use-cspf=no \ hops=192.168.33.10:strict,192.168.33.13:strict,192.168.33.14:strict /interface traffic-eng add bandwidth=5Mbps name=TE-to-R1 to-address=10.255.0.1 primary-path=tun-second-link \ secondary-paths=dyn record-route=yes from-address=10.255.0.3
Verify that TE tunnels are working
[admin@R1] /interface traffic-eng> monitor 0 tunnel-id: 14 primary-path-state: established primary-path: tun-first-link secondary-path-state: not-necessary active-path: tun-first-link active-lspid: 1 active-label: 39 explicit-route: S:192.168.33.2/32,S:192.168.33.5/32,S:192.168.33.6/32 reserved-bandwidth: 5.0Mbps
Notice that running router will show assigned MPLS lables, whole tunnel path and reserved bandwidth. Reserved resources also can be monitored on each router:
[admin@R1] /mpls traffic-eng> path-state print Flags: L - locally-originated, E - egress, F - forwarding, P - sending-path, R - sending-resv # SRC DST BANDWIDTH OUT.. OUT-NEXT-HOP 0 LFP 10.255.0.1:1 10.255.0.3:15 5.0Mbps eth.. 192.168.33.2 1 E R 10.255.0.3:1 10.255.0.1:8 5.0Mbps [admin@R1] /mpls traffic-eng> resv-state print Flags: E - egress, A - active, N - non-output, S - shared # SRC DST BANDWIDTH LABEL INT... 0 AS 10.255.0.1:1 10.255.0.3:15 5.0Mbps 41 ether1 [admin@R1] /mpls traffic-eng> [admin@R1] /mpls traffic-eng> interface print Flags: X - disabled, I - invalid # INTERFACE BANDWIDTH TE-METRIC REMAINING-BW 0 ether1 10Mbps 1 5.0Mbps 1 ether2 10Mbps 1 10.0Mbp
Notice that remaining bandwidth on interface decreased. It means that if multiple tunnels are created and whole bandwidth on that particular interface is used, then tunnel will try to look for different path.
Route Traffic over TE
To route LAN traffic over TE tunnel we will assign address 10.99.99.1/30 and 10.99.99.2/30 to each tunnel end.
/ip address add address=10.99.99.1/30 /ip route add dst-address=192.168.20.0/24 gateway=10.99.99.2
/ip address add address=10.99.99.2/30 /ip route add dst-address=192.168.10.0/24 gateway=10.99.99.1
To verify if traffic is actually going over TE tunnel and is label switched we can run traceroute:
[admin@R1] /ip address> /tool traceroute 10.99.99.1 # ADDRESS RT1 RT2 RT3 STATUS 1 192.168.33.2 2ms 1ms 1ms <MPLS:L=41,E=0> 2 10.99.99.1 3ms 1ms 1ms
As you can see traceroute recorded MPLS label in the path.
Congratulations our setup works.