How to Explicitly Configure an Entire Label-switched Path in Junos

By Walter J. Goralski, Cathy Gadecki, Michael Bushong

In some cases, you may want to have a bit more control over the path a label-switched path (LSP) takes. For example, you may want to do the following:

  • Ensure that the very first hop in an LSP is a specific router.

  • Make sure that traffic flows from router 1 to router 2 to router 3, in that order.

  • Bound a path at a couple of points, allowing the routers to decide how to get between those points.

    Exerting more control over an LSP path.

    Exerting more control over an LSP path.

Imagine that you want traffic in the LSP to travel from the ingress point directly to router 3. From router 3, you want to make sure that it passes through router 5, but you don’t care how it gets to router 5. And then from router 5, you want to make sure that the traffic passes through router 7 before being forwarded to the egress point for the LSP.

Configuration for this type of more constrained LSP is handled through the path configuration:

[edit protocols mpls]
path to-router3 {
   10.0.18.1 strict;
   10.0.22.1 loose;
   10.0.29.1 loose;
}

The strict keyword indicates that traffic has to flow directly to that router. It can’t go through any other router in the LSP en route to that router. If you specify two strict addresses in a row, it means that traffic has to flow directly through those two routers without any path deviations in the middle.

Then, after traffic flows through 10.0.18.1, it can take any path and any number of hops (to be determined by the underlying IGP) to 10.0.22.1. From there, the traffic passes through any number of hops to 10.0.29.1, and eventually the traffic is forwarded to the LSP egress router.

Again, to verify the path, use the traceroute command:

user@gateway> traceroute new-york 
traceroute to new-york (192.168.24.1), 30 hops max, 40 byte packets
 1  router5 (192.168.14.1)  0.869 ms  0.638 ms  0.536 ms
    MPLS Label-100004 CoS=0 TTL=1 S=1
 2  router4 (192.168.17.1)  0.869 ms  0.638 ms  0.536 ms
    MPLS Label-100004 CoS=0 TTL=1 S=1
 3  10.0.18.1 (10.0.18.1)  24.968 ms  0.727 ms  0.363 ms
    MPLS Label-100004 CoS=0 TTL=1 S=1
 4  10.0.22.1 (10.0.22.1)  0.869 ms  0.638 ms  0.536 ms
    MPLS Label-100004 CoS=0 TTL=1 S=1
 5  10.0.29.1 (10.0.29.1)  24.968 ms  0.727 ms  0.363 ms
 6  new-york (192.168.24.1)  24.968 ms  0.727 ms  0.363 ms