Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Configuring Backup Selection Policy for the OSPF or OSPF3 Protocol

 

This example shows how to configure the backup selection policy for the OSPF or OSPF3 protocol, which enables you to select a loop-free alternate (LFA) in the network.

When you enable backup selection policies, Junos OS allows selection of LFA based on the policy rules and attributes of the links and nodes in the network. These attributes are admin-group, srlg, bandwidth, protection-type, metric, and node.

Requirements

This example uses the following hardware and software components:

  • Eight routers that can be a combination of M Series Multiservice Edge Routers, MX Series 5G Universal Routing Platforms, PTX Series Packet Transport Routers, and T Series Core Routers

  • Junos OS Release 15.1 or later running on all devices

Before you begin:

  1. Configure the device interfaces.

  2. Configure OSPF.

Overview

In Junos OS, the default loop-free alternative (LFA) selection algorithm or criteria can be overridden with an LFA policy. These policies are configured for each destination (IPv4 and IPv6) and a primary next-hop interface . These backup policies enforce LFA selection based on admin-group, srlg, bandwidth, protection-type, metric, and node attributes of the backup path. During backup shortest-path-first (SPF) computation, each attribute (both node and link) of the backup path, stored per backup next-hop, is accumulated by IGP. For the routes created internally by IGP, the attribute set of every backup path is evaluated against the policy configured for each destination (IPv4 and IPv6) and a primary next-hop interface. The first or the best backup path is selected and installed as the backup next hop in the routing table. To configure the backup selection policy, include the backup-selection configuration statement at the [edit routing-options] hierarchy level. The show backup-selection command displays the configured policies for a given interface and destination. The display can be filtered against a particular destination, prefix, interface, or logical systems.

Topology

In this topology shown in Figure 1, the backup selection policy is configured on Device R3.

Figure 1: Example Backup Selection Policy for OSPF or OPSF3
Example Backup Selection Policy
for OSPF or OPSF3

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

R0

R1

R2

R3

R4

R5

R6

R7

Configuring Device R3

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device R3:

  1. Configure the interfaces.
  2. Configure srlg values.
  3. Configure the ID of the router.
  4. Apply the routing policy to all equal-cost multipaths exported from the routing table to the forwarding table.
  5. Configure attributes of the backup selection policy.
  6. Enable RSVP on all the interfaces.
  7. Configure administrative groups.
  8. Enable MPLS on all the interfaces and configure administrative group for an interface.
  9. Enable link protection and configure metric values on all the interfaces for an OSPF area.
  10. Enable link protection and configure metric values on all the interfaces for an OSPF3 area.
  11. Configure the routing policy.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying the Routes

Purpose

Verify that the expected routes are learned.

Action

From operational mode, run the show route command for the routing table.

user@R3> show route

Meaning

The output shows all Device R3 routes.

Verifying the OSPF Route

Purpose

Verify the routing table of OSPF.

Action

From operational mode, run the show ospf route detail command for Device R3.

user@R3> show ospf route detail

Meaning

The output displays the routing table of OSPF routers.

Verifying the OSPF3 Route

Purpose

Verify the routing table of OSPF3.

Action

From operational mode, run the show ospf3 route detail command for Device R3.

user@R3> show ospf3 route detail

Meaning

The output displays the routing table of OSPF3 routers.

Verifying the Backup Selection Policy for Device R3

Purpose

Verify the backup selection policy for Device R3.

Action

From operational mode, run the show backup-selection command for Device R3.

user@R3> show backup-selection

Meaning

The output displays the configured policies per prefix per primary next-hop interface.