MikroTik RouterOS MPLS Traffic Engineering: Explicit Path Control
MikroTik RouterOS MPLS Traffic Engineering: Explicit Path Control
Section titled âMikroTik RouterOS MPLS Traffic Engineering: Explicit Path ControlâRouterOS Version: 6.x / 7.x (syntax differs) Difficulty: Advanced Estimated Time: 60 minutes
Overview
Section titled âOverviewâMPLS Traffic Engineering (MPLS-TE) gives you explicit control over how traffic traverses your network. Unlike standard IP routing where packets follow the shortest path calculated by your IGP, TE tunnels let you define specific paths based on bandwidth requirements, link properties, or administrative policies.
The key difference from LDP-based MPLS is control: LDP automatically creates label-switched paths following IGP routes, while RSVP-TE creates paths you define - either explicitly hop-by-hop, or dynamically via Constrained Shortest Path First (CSPF) calculations that respect bandwidth and other constraints.
TE tunnels in RouterOS appear as interfaces. You can route traffic into them, assign IP addresses, and use them as transport for VPLS or MPLS VPNs. They are unidirectional - if you need bidirectional communication, create tunnels in both directions.
When to Use MPLS-TE
Section titled âWhen to Use MPLS-TEâMPLS-TE solves specific problems that standard routing cannot:
| Scenario | Why TE Helps |
|---|---|
| Link utilization imbalance | Route traffic away from congested paths |
| Latency-sensitive applications | Force traffic over lower-latency links |
| Bandwidth guarantees | Reserve capacity along specific paths |
| Disaster recovery | Pre-establish backup paths through alternate routes |
| Multi-tenant isolation | Separate customer traffic onto different physical paths |
When NOT to use MPLS-TE: If your network is small, has uniform link capacity, or doesnât require explicit path control, standard LDP-based MPLS is simpler and sufficient.
Core Concepts
Section titled âCore ConceptsâLabel Switched Paths (LSPs)
Section titled âLabel Switched Paths (LSPs)âAn LSP is the path that MPLS-labeled packets follow through the network. With TE, you control this path rather than leaving it to the IGP.
Head-End Tail-End R1 ââ[Push Label]âââ R2 ââ[Swap Label]âââ R3 ââ[Pop Label]âââ R4 TE Tunnel Interface Tunnel DestinationRSVP-TE Signaling
Section titled âRSVP-TE SignalingâRSVP-TE establishes the tunnel by sending Path messages from head-end to tail-end, then Resv messages back confirming the reservation. This process:
- Reserves resources (bandwidth) along the path
- Distributes labels at each hop
- Establishes the LSP
Path Types
Section titled âPath TypesâExplicit Path: You define every hop the tunnel must traverse.
- Use when you need guaranteed routing through specific nodes
- Requires knowing your network topology
Dynamic Path (CSPF): RouterOS calculates the path based on constraints.
- Use when you want constraint-based routing without manual hop specification
- Requires OSPF with TE extensions enabled
Configuration Steps
Section titled âConfiguration StepsâStep 1: Enable TE on Interfaces
Section titled âStep 1: Enable TE on InterfacesâBefore creating tunnels, enable Traffic Engineering on interfaces that will participate in TE paths:
# RouterOS 6.x syntax/mpls traffic-eng interface add interface=ether1 bandwidth=1000000000/mpls traffic-eng interface add interface=ether2 bandwidth=1000000000
# RouterOS 7.x syntax/mpls/traffic-eng/interface/add interface=ether1 bandwidth=1000000000/mpls/traffic-eng/interface/add interface=ether2 bandwidth=1000000000The bandwidth parameter is administrative - it tells CSPF how much capacity is available for path calculations. Set it to your link speed or the capacity you want to advertise.
Step 2: Configure OSPF for TE (Required for CSPF)
Section titled âStep 2: Configure OSPF for TE (Required for CSPF)âIf using dynamic CSPF paths, OSPF must distribute TE information:
# RouterOS 6.x/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.1
# RouterOS 7.x/routing/ospf/instance/set default mpls-te-area=backbone mpls-te-router-id=10.255.255.1mpls-te-area: The OSPF area where TE opaque LSAs are floodedmpls-te-router-id: Usually your loopback address; identifies this router in TE
Apply this configuration on ALL routers in the TE domain.
Step 3: Create Tunnel Paths
Section titled âStep 3: Create Tunnel PathsâDefine how the tunnel should be routed:
Option A: Dynamic Path Using CSPF
/mpls traffic-eng tunnel-path add name=dynamic-to-r4 use-cspf=yesCSPF calculates the path automatically based on available bandwidth and link metrics.
Option B: Explicit Path with Strict Hops
/mpls traffic-eng tunnel-path add name=explicit-to-r4 use-cspf=no \ hops=192.168.12.2:strict,192.168.23.2:strict,192.168.34.2:strictWith strict hops, packets must traverse directly between the specified addresses - they must be adjacent routers.
Option C: Explicit Path with Loose Hops
/mpls traffic-eng tunnel-path add name=loose-to-r4 use-cspf=no \ hops=10.255.255.2:loose,192.168.34.2:strictLoose hops allow intermediate routers between specified points. The last hop should typically be strict and use the interface IP (not loopback) of the destination.
Step 4: Create the TE Tunnel
Section titled âStep 4: Create the TE Tunnelâ/interface traffic-eng add name=te-to-r4 \ to-address=10.255.255.4 \ bandwidth=100000000 \ primary-path=dynamic-to-r4 \ disabled=noto-address: The tail-end routerâs address (usually loopback)bandwidth: Bandwidth to reserve (administrative, affects CSPF calculations on other tunnels)primary-path: Reference to the tunnel-path entry
Step 5: Enable the Tunnel
Section titled âStep 5: Enable the TunnelâTunnels are disabled by default. Enable after configuration:
/interface traffic-eng enable te-to-r4Complete Example: Four Router Topology
Section titled âComplete Example: Four Router TopologyâConsider this network topology:
R1 ââââââââââ R2 â â â â R4 ââââââââââ R3Goal: Create a TE tunnel from R1 to R3 that goes through R2 (avoiding the R1-R4-R3 path).
R1 Configuration (Head-End)
Section titled âR1 Configuration (Head-End)â# Enable TE on interfaces/mpls traffic-eng interfaceadd interface=ether1-to-r2 bandwidth=1000000000add interface=ether2-to-r4 bandwidth=1000000000
# Configure OSPF for TE/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.1
# Create explicit path through R2/mpls traffic-eng tunnel-path add name=via-r2 use-cspf=no \ hops=192.168.12.2:strict,192.168.23.2:strict
# Create TE tunnel/interface traffic-eng add name=te-to-r3 \ to-address=10.255.255.3 \ bandwidth=100000000 \ primary-path=via-r2 \ record-route=yes \ disabled=noR2 Configuration (Transit)
Section titled âR2 Configuration (Transit)â# Enable TE on interfaces/mpls traffic-eng interfaceadd interface=ether1-to-r1 bandwidth=1000000000add interface=ether2-to-r3 bandwidth=1000000000
# Configure OSPF for TE/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.2R3 Configuration (Tail-End)
Section titled âR3 Configuration (Tail-End)â# Enable TE on interfaces/mpls traffic-eng interfaceadd interface=ether1-to-r2 bandwidth=1000000000add interface=ether2-to-r4 bandwidth=1000000000
# Configure OSPF for TE/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.3R4 Configuration (Not in Tunnel Path)
Section titled âR4 Configuration (Not in Tunnel Path)â# Enable TE on interfaces (for OSPF TE database completeness)/mpls traffic-eng interfaceadd interface=ether1-to-r1 bandwidth=1000000000add interface=ether2-to-r3 bandwidth=1000000000
# Configure OSPF for TE/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.4Adding Failover with Secondary Paths
Section titled âAdding Failover with Secondary PathsâFor resilience, configure a secondary path that activates if the primary fails:
# Create backup path (dynamic, will find any available route)/mpls traffic-eng tunnel-path add name=backup-dynamic use-cspf=yes
# Update tunnel with secondary path/interface traffic-eng set te-to-r3 \ secondary-paths=backup-dynamic \ primary-retry-interval=30sWhen the primary path fails (link down, RSVP timeout), the tunnel switches to the secondary path. The primary-retry-interval controls how often RouterOS attempts to re-establish the primary.
Using TE Tunnels for Traffic
Section titled âUsing TE Tunnels for TrafficâTE tunnels appear as interfaces. To use them:
Option 1: Static Routes
Section titled âOption 1: Static Routesâ/ip route add dst-address=10.100.0.0/24 gateway=te-to-r3Option 2: Assign IP Address and Use Routing
Section titled âOption 2: Assign IP Address and Use Routingâ/ip address add address=172.16.0.1/30 interface=te-to-r3Then establish routing (static or dynamic) over the tunnel.
Option 3: VPLS Transport
Section titled âOption 3: VPLS Transportâ/interface vpls add name=vpls1 remote-peer=10.255.255.3 use-explicit-path=te-to-r3Verification
Section titled âVerificationâCheck 1: Verify TE Interfaces
Section titled âCheck 1: Verify TE Interfacesâ/mpls traffic-eng interface printExpected Output:
Flags: X - disabled # INTERFACE BANDWIDTH 0 ether1-to-r2 1000000000 1 ether2-to-r4 1000000000Check 2: Verify Tunnel Status
Section titled âCheck 2: Verify Tunnel Statusâ/interface traffic-eng printExpected Output:
Flags: X - disabled, R - running # NAME TO-ADDRESS BANDWIDTH PRIMARY-PATH ACTUAL-PATH 0 R te-to-r3 10.255.255.3 100000000 via-r2 via-r2The R flag indicates the tunnel is running (established).
Check 3: Monitor Tunnel Details
Section titled âCheck 3: Monitor Tunnel Detailsâ/interface traffic-eng monitor te-to-r3 onceExpected Output:
tunnel-id: 1 primary-path-state: established secondary-path-state: not-configured active-path: via-r2 active-lspid: 1 active-label: 18 explicit-route: 192.168.12.2->192.168.23.2 recorded-route: 192.168.12.2[18]->192.168.23.2[impl-null] reserved-bandwidth: 100000000Key fields:
primary-path-state: established- Tunnel is upexplicit-route- The path being usedrecorded-route- Actual path with labels
Check 4: Verify OSPF TE Configuration
Section titled âCheck 4: Verify OSPF TE Configurationâ/routing ospf instance printExpected Output:
name: default mpls-te-area: backbone mpls-te-router-id: 10.255.255.1Check 5: Check MPLS Forwarding Table
Section titled âCheck 5: Check MPLS Forwarding Tableâ/mpls forwarding-table printExpected Output: Should show label bindings for the tunnel.
Troubleshooting
Section titled âTroubleshootingâProblem: âTunnel stuck on hold, never establishesâ
Section titled âProblem: âTunnel stuck on hold, never establishesââCause: RSVP protocol not running on intermediate routers.
Solution:
- Verify all routers along the path have TE interfaces configured
- For mixed vendor networks (e.g., Cisco), ensure RSVP is enabled:
! Cisco IOSinterface GigabitEthernet0/0ip rsvp bandwidthmpls traffic-eng tunnels
- Check RSVP neighbors:
/mpls rsvp interface print
Problem: âCSPF not finding a pathâ
Section titled âProblem: âCSPF not finding a pathââCause: OSPF not distributing TE information or bandwidth exhausted.
Solution:
- Verify OSPF TE configuration on all routers:
Must show/routing ospf instance print
mpls-te-areaandmpls-te-router-id - Check available bandwidth:
/mpls traffic-eng interface print
- Reduce tunnel bandwidth requirement or increase interface bandwidth
Problem: âTunnel establishes but traffic doesnât flowâ
Section titled âProblem: âTunnel establishes but traffic doesnât flowââCause: Routing not configured to use the tunnel.
Solution:
- Add static route pointing to tunnel interface:
/ip route add dst-address=DESTINATION gateway=te-tunnel-name
- Or assign IP to tunnel and configure dynamic routing
Problem: âPath takes unexpected routeâ
Section titled âProblem: âPath takes unexpected routeââCause: CSPF bug in some RouterOS versions or metric misconfiguration.
Solution:
- Use explicit path with loose hops to constrain the route:
/mpls traffic-eng tunnel-path set [find name=my-path] \hops=INTERMEDIATE_ROUTER:loose,FINAL_HOP:strict
- Upgrade RouterOS if using an older version
Problem: âLast hop in explicit path rejectedâ
Section titled âProblem: âLast hop in explicit path rejectedââCause: Last hop must be interface IP of destination router, not loopback.
Solution: Use the actual interface IP that receives traffic on the tail-end router:
# Wrong - loopback as last hophops=192.168.12.2:strict,10.255.255.3:strict
# Correct - interface IP as last hophops=192.168.12.2:strict,192.168.23.2:strictProblem: âBandwidth not being enforcedâ
Section titled âProblem: âBandwidth not being enforcedââCause: TE bandwidth is administrative only - RSVP reserves it for path calculations but doesnât police traffic.
Solution: Add queue to limit actual traffic:
/queue simple add name=te-limit target=te-to-r3 max-limit=100M/100MCommon Pitfalls
Section titled âCommon Pitfallsâ1. Forgetting Tunnels Are Unidirectional
Section titled â1. Forgetting Tunnels Are UnidirectionalâWrong: Expecting return traffic to use the same path
# Only creates tunnel R1 â R3/interface traffic-eng add name=te-to-r3 to-address=10.255.255.3 ...Right: Create tunnels in both directions
# On R1: tunnel to R3/interface traffic-eng add name=te-to-r3 to-address=10.255.255.3 ...
# On R3: tunnel to R1/interface traffic-eng add name=te-to-r1 to-address=10.255.255.1 ...2. Using Loopback as Last Explicit Hop
Section titled â2. Using Loopback as Last Explicit HopâWrong: Loopback address as final hop
/mpls traffic-eng tunnel-path add name=path1 hops=192.168.12.2:strict,10.255.255.3:strictRight: Interface IP as final hop
/mpls traffic-eng tunnel-path add name=path1 hops=192.168.12.2:strict,192.168.23.2:strict3. Missing OSPF TE Configuration
Section titled â3. Missing OSPF TE ConfigurationâWrong: Creating tunnels without OSPF TE
# No mpls-te-area configured - CSPF won't work/interface traffic-eng add name=te1 to-address=10.255.255.3 primary-path=dynamic-pathRight: Configure OSPF TE first
/routing ospf instance set default mpls-te-area=backbone mpls-te-router-id=10.255.255.14. Assuming Bandwidth Limits Traffic
Section titled â4. Assuming Bandwidth Limits TrafficâWrong: Thinking reserved bandwidth enforces limits
# This doesn't actually limit traffic to 100Mbps/interface traffic-eng add name=te1 bandwidth=100000000 ...Right: Add queues for traffic policing
/interface traffic-eng add name=te1 bandwidth=100000000 .../queue simple add name=te1-limit target=te1 max-limit=100M/100M5. RouterOS 7 Syntax Mismatch
Section titled â5. RouterOS 7 Syntax MismatchâWrong: Using v6 syntax in v7
/mpls traffic-eng interface add interface=ether1 # Fails in v7Right: Use v7 slash syntax
/mpls/traffic-eng/interface/add interface=ether1Advanced Configuration
Section titled âAdvanced ConfigurationâAuto-Bandwidth Adjustment
Section titled âAuto-Bandwidth AdjustmentâRouterOS can automatically adjust tunnel bandwidth based on actual usage:
/interface traffic-eng set te-to-r3 \ auto-bandwidth-avg-interval=5m \ auto-bandwidth-update-interval=1hauto-bandwidth-avg-interval: Window for calculating average trafficauto-bandwidth-update-interval: How often to update the reservation
Reoptimization
Section titled âReoptimizationâForce the tunnel to recalculate its path:
# Manual reoptimization/interface traffic-eng reoptimize te-to-r3
# Automatic reoptimization/interface traffic-eng set te-to-r3 reoptimize-interval=5mPreemption Priorities
Section titled âPreemption PrioritiesâControl which tunnels can preempt others when bandwidth is scarce:
/interface traffic-eng set te-to-r3 \ setup-priority=3 \ holding-priority=3- Priority 0 is highest (can preempt anything)
- Priority 7 is lowest (can be preempted by anything)
setup-priority: Ability to preempt existing tunnelsholding-priority: Resistance to being preempted
Limitations
Section titled âLimitationsâ- No Fast Reroute: RouterOS doesnât support MPLS local protection. Failover relies on RSVP re-signaling (seconds, not milliseconds)
- No Link/Node Protection: Pre-established backup paths at transit routers not supported
- Administrative Bandwidth: Doesnât reflect actual link capacity or enforce traffic limits
- IPv4 Only: IPv6 TE tunnel support is limited/experimental
- Documentation Gaps: Some v7 features may not be fully documented
Related Topics
Section titled âRelated TopicsâMPLS Fundamentals
Section titled âMPLS Fundamentalsâ- MPLS Basics - LDP-based MPLS introduction
- VPLS - Layer 2 VPN over MPLS
Routing Protocols
Section titled âRouting Protocolsâ- OSPF - required for CSPF
- BGP - BGP over MPLS-TE tunnels
- Static Routes - routing traffic into tunnels
Bandwidth Management
Section titled âBandwidth Managementâ- Simple Queues - enforce TE bandwidth limits
- Queue Tree - advanced QoS on TE tunnels
High Availability
Section titled âHigh AvailabilityâRelated Features
Section titled âRelated Featuresâ- Interfaces Overview - TE tunnel interfaces
- Firewall Mangle - traffic marking for TE
References
Section titled âReferencesâ- MikroTik MPLS Overview
- MikroTik Traffic Engineering
- RFC 3209 - RSVP-TE - Extensions to RSVP for LSP Tunnels
- RFC 3630 - OSPF-TE - Traffic Engineering Extensions to OSPF