Configuring Backup Selection Policy for the OSPF Protocol
Support for OSPF loop-free alternate (LFA) routes essentially adds IP fast-reroute capability for OSPF. Junos OS precomputes multiple loop-free backup routes for all OSPF routes. These backup routes are pre-installed in the Packet Forwarding Engine, which performs a local repair and implements the backup path when the link for a primary next hop for a particular route is no longer available. The selection of LFA is done randomly by selecting any matching LFA to progress to the given destination. This does not ensure best backup coverage available for the network. In order to choose the best LFA, Junos OS allows you to configure network-wide backup selection policies for each destination (IPv4 and IPv6) and a primary next-hop interface. These policies are evaluated based on admin-group, srlg, bandwidth, protection-type, metric, and node information.
Before you begin to configure the backup selection policy for the OSPF protocol:
Configure the router interfaces. See the Junos OS Network Management Administration Guide for Routing Devices.
Configure an interior gateway protocol or static routing. See the Junos OS Routing Protocols Library for Routing Devices.
To configure the backup selection policy for the OSPF protocol:
- Configure per-packet load balancing.
[edit policy-options] user@host# set policy-statement ecmp term 1 then load-balance per-packet
- Enable RSVP on all the interfaces.
[edit protocols] user@host# set rsvp interface all
- Configure administrative groups.
[edit protocols mpls] user@host# set admin-groups group-name
- Configure srlg values.
[edit routing-options] user@host# set srlg srlg-name srlg-value srlg-value
- Enable MPLS on all the interfaces.
[edit protocols mpls] user@host# set interface all
- Apply MPLS to an interface configured with an administrative
group.
[edit protocols mpls] user@host# set interface interface-name admin-group group-name
- Configure the ID of the router.
[edit routing-options] user@host# set router-id router-id
- Apply the routing policy to all equal cost multipaths
exported from the routing table to the forwarding table.
[edit routing-options] user@host# set forwarding-table export ecmp
- Enable link protection and configure metric values on
all the interfaces for an area.
[edit protocols ospf] user@host# set area area-id interface interface-name link-protection user@host# set area area-id interface interface-name metric metric
- Configure the administrative group of the backup selection
policy for an IP address.
You can choose to exclude, include all, include any, or prefer the administrative groups from the backup path.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name admin-group
Specify the administrative group to be excluded.
[edit routing-options backup-selection destination ip-address interface interface-name admin-group] user@host# set exclude group-name
The backup path is not selected as the loop-free alternate (LFA) or backup nexthop if any of the links in the path have any one of the listed administrative groups.
For example, to exclude the group c1 from the administrative group:
[edit routing-options backup-selection destination 0.0.0.0/0 interface all admin-group] user@host# set exclude c1
Configure all the administrative groups if each link in the backup path requires all the listed administrative groups in order to accept the path.
[edit routing-options backup-selection destination ip-address interface interface-name admin-group] user@host# set include-all group-name
For example, to set all the administrative groups if each link requires all the listed administrative groups in order to accept the path:
[edit routing-options backup-selection destination 0.0.0.0/0 interface all admin-group] user@host# set include-all c2
Configure any administrative group if each link in the backup path requires at least one of the listed administrative groups in order to select the path.
[edit routing-options backup-selection destination ip-address interface interface-name admin-group] user@host# set include-any group-name
For example, to set any administrative group if each link in the backup path requires at least one of the listed administrative groups in order to select the path:
[edit routing-options backup-selection destination 0.0.0.0/0 interface all admin-group] user@host# set include-any c3
Define an ordered set of an administrative group that specifies the preference of the backup path.
The leftmost element in the set is given the highest preference.
[edit routing-options backup-selection destination ip-address interface interface-name admin-group] user@host# set preference group-name
For example, to set an ordered set of an administrative group that specifies the preference of the backup path:
[edit routing-options backup-selection destination 0.0.0.0/0 interface all admin-group] user@host# set preference c4
- Configure the backup path to allow the selection of the
backup next hop only if the bandwidth is greater than or equal to
the bandwidth of the primary next hop.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name bandwidth-greater-equal-primary
- Configure the backup path to specify the metric from the
one-hop neighbor or from the remote router such as an RSVP backup
label-switched-path (LSP) tail-end router to the final destination.
The destination metric can be either highest or lowest.
Configure the backup path that has the highest destination metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name dest-metric highest
Configure the backup path that has the lowest destination metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name dest-metric lowest
- Configure the backup path that is a downstream path to
the destination.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name downstream-paths-only
- Set the order of preference of the root and the destination
metric during backup path selection.
The preference order can be :
[root dest] — Backup path selection or preference is first based on the root-metric criteria. If the criteria of all the root-metric is the same, then the selection or preference is based on the dest-metric.
[dest root] — Backup path selection or preference is first based on the dest-metric criteria. If the criteria of all the dest-metric is the same, then the selection is based on the root-metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name metric-order dest user@host# set backup-selection destination ip-address interface interface-name metric-order root
- Configure the backup path to define a list of loop-back
IP addresses of the adjacent neighbors to either exclude or prefer
in the backup path selection.
The neighbor can be a local (adjacent router) neighbor, remote neighbor, or any other router in the backup path.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name node
Configure the list of neighbors to be excluded.
[edit routing-options backup-selection destination ip-address interface interface-name node] user@host# set exclude node-address
The backup path that has a router from the list is not selected as the loop-free alternative or backup next hop.
Configure an ordered set of neighbors to be preferred.
[edit routing-options backup-selection destination ip-address interface interface-name node] user@host# set preference node-address
The backup path having the leftmost neighbor is selected.
- Configure the backup path to specify the required protection
type of the backup path to be link, node, or node-link.
Select the backup path that provides link protection.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name protection-type link
Select the backup path that provides node protection.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name protection-type node
Select the backup path that allows either node or link protection LFA where node-protection LFA is preferred over link-protection LFA.
[edit routing-options] user@host# set backup-selection destination ip-address interface interface-name protection-type node-link
- Specify the metric to the one-hop neighbor or to the remote
router such as an RSVP backup label-switched-path (LSP) tail-end router.
Select the path with highest root metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface all root-metric highest
Select the path with lowest root metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface all root-metric lowest
- Configure the backup selection path to either allow or
reject the common shared risk link groups (SRLGs) between the primary
link and each link in the backup path.
Configure the backup path to allow common srlgs between the primary link and each link in the backup path.
[edit routing-options] user@host# set backup-selection destination ip-address interface all srlg loose
A backup path with a fewer number of srlg collisions is preferred.
Configure the backup path to reject the backup path that has common srlgs between the primary next-hop link and each link in the backup path.
[edit routing-options] user@host# set backup-selection destination ip-address interface all srlg strict
- Configure the backup path to control the order and the
criteria of evaluating the backup path based on the administrative
group, srlg, bandwidth, protection type, node, and metric.
The default order of evaluation is admin-group, srlg, bandwidth, protection-type, node, and metric.
[edit routing-options] user@host# set backup-selection destination ip-address interface all evaluation-order admin-group user@host# set backup-selection destination ip-address interface all evaluation-order srlg user@host# set backup-selection destination ip-address interface all evaluation-order bandwidth