Configuring Path Protection in an MPLS Network (CLI Procedure)
The Junos OS implementation of MPLS on EX Series switches provides path protection as a mechanism for protecting against label switched path (LSP) failures. Path protection reduces the time required to recalculate a route in case of a failure within the MPLS tunnel. You configure path protection on the ingress provider edge switch in your MPLS network. You do not configure the egress provider edge switch or the provider switches for path protection. You can explicitly specify which provider switches are used for the primary and secondary paths, or you can let the software calculate the paths automatically.
Before you configure path protection, be sure you have:
- Configured an ingress provider edge switch and an egress provider edge switch. See Configuring MPLS on Provider Edge Switches Using IP Over MPLS (CLI Procedure) or Configuring MPLS on Provider Edge Switches Using Circuit Cross-Connect (CLI Procedure).
- Configured at least one provider (transit) switch. See Configuring MPLS on Provider Switches (CLI Procedure).
- Verified the configuration of your MPLS network. See Verifying That MPLS Is Working Correctly.
To configure path protection, complete the following tasks on the ingress provider edge switch:
Configuring the Primary Path
The primary statement creates the primary path, which is the LSP’s preferred path. The secondary statement creates an alternative path if the primary path can no longer reach the egress provider edge switch.
In the tasks described in this topic, the lsp-name has already been configured on the ingress provider edge switch as lsp_to_240 and the loopback interface address on the remote provider edge switch has already been configured as 127.0.0.8.
When the software switches from the primary to the secondary path, it continuously attempts to revert to the primary path, switching back to it when it is again reachable but no sooner than the retry time specified in the revert-timer statement.
You can configure zero primary paths or one primary path. If you do not configure a primary path, the first secondary path (if a secondary path has been configured) is selected as the path. If you do not specify any named paths, or if the path that you specify is empty, the software makes all routing decisions necessary for the packets to reach the egress provider edge switch.
To configure a primary path:
- Create the primary path for the LSP:
[edit protocols mpls label-switched-path lsp_to_240 to 127.0.0.8]
user@switch# set primary primary_path_lsp_to_240 - Configure an explicit route for the primary path by specifying
the IP address of the loopback interface or the switch IP address
or hostname of each switch used in the MPLS tunnel. You can specify
the link types as either strict or loose in each path statement. If the link type is strict, the LSP
must go to the next address specified in the path statement
without traversing other switches. If the link type is loose, the LSP can traverse through other switches before reaching this
switch. This configuration uses the default strict designation
for the paths.

Note: You can enable path protection without specifying which provider switches are used. If you do not list the specific provider switches to be used for the MPLS tunnel, the switch calculates the route.

Tip: Do not include the ingress provider edge switch in these statements. List the IP address of the loopback interface or switch address or hostname of all other switch hops in sequence, ending with the egress provider edge switch.
[edit protocols mpls label-switched-path lsp_to_240 to 127.0.0.8]
user@switch# set path primary_path_lsp_to_240 127.0.0.2
user@switch# set path primary_path_lsp_to_240 127.0.0.3
user@switch# set path primary_path_lsp_to_240 127.0.0.8
Configuring the Secondary Path
You can configure zero or more secondary paths. All secondary paths are equal, and the software tries them in the order that they are listed in the configuration. The software does not attempt to switch among secondary paths. If the first secondary path in the configuration is not available, the next one is tried, as so on. To create a set of equal paths, specify secondary paths without specifying a primary path. If you do not specify any named paths, or if the path that you specify is empty, the software makes all routing decisions necessary to reach the egress provider edge switch.
To configure the secondary path:
- Create a secondary path for the LSP:
- Configure an explicit route for the secondary path by
specifying the IP address of the loopback interface or the switch
IP address or hostname of each switch used in the MPLS tunnel. You
can specify the link types as either strict or loose in each path statement. This configuration uses the default strict designation for the paths.

Tip: Do not include the ingress provider edge switch in these statements. List the IP address of the loopback interface or switch address or hostname of all other switch hops in sequence, ending with the egress provider edge switch.
[edit protocols mpls label-switched-path lsp_to_240 to 127.0.0.8]
user@switch# set path secondary_path_lsp_to_240 127.0.0.4
user@switch# set path primary_path_lsp_to_240 127.0.0.8
Configuring the Revert Timer
For LSPs configured with both primary and secondary paths, you can optionally configure a revert timer. If the primary path goes down and traffic is switched to the secondary path, the revert timer specifies the amount of time (in seconds) that the LSP must wait before it can revert traffic back to the primary path. If the primary path experiences any connectivity problems or stability problems during this time, the timer is restarted.
![]() | Tip: If you do not explicitly configure the revert timer, it is set by default to 60 seconds. |
To configure the revert timer for LSPs configured with primary and secondary paths:
- For all LSPs on the switch:
[edit protocols mpls]
user@switch# set revert-timer 120 - For a specific LSP on the switch:
[edit protocols mpls label-switched-path]
user@switch# set lsp_to_240 revert-timer 120

