Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configuring the Priority for Route Prefixes in the RPD Infrastructure

This example shows how to configure priority for route prefixes in the RPD infrastructure for the OSPF, LDP, and BGP protocols.

Requirements

This example uses the following hardware and software components:

  • Three routers in a combination of ACX Series, M Series, MX Series, PTX Series, and T Series.

  • Junos OS Release 16.1 or later running on all devices.

Before you begin:

  1. Configure the device interfaces.

  2. Configure the following protocols:

    • BGP

    • MPLS

    • OSPF

    • LDP

Overview

In a network with a large number of routes, it is sometimes important to control the order in which routes get updated for better convergence and to provide differentiated services. Prefix prioritization helps users to prioritize certain routes/prefixes over others and have control over the order in which routes get updated in the RIB (routing table) and the FIB (forwarding table). In Junos OS Release 16.1 and later, you can control the order in which the routes get updated from LDP/OSPF to rpd and rpd to kernel. You can specify a priority of high or low through the existing import policy in the protocols. In the event of a topology change, high priority prefixes are updated in the routing table first, followed by low priority prefixes. In general, routes that are not explicitly assigned a priority are treated as medium priority. Within the same priority level, routes will continue to be updated in lexicographic order.

In this example, the routing device is in area 0.0.0.0, with interface ge-1/3/0 connected to the neighboring device. You configure three import routing policies: next-hop-self, ospf-prio, and prio_for_bgp. The routing policy next-hop-self accepts routes from BGP. For the OSPF routing policy, routes matching 172.16.25.3/32 are installed first because they have a priority of high. LDP imports routes from OSPF. For BGP prioritization, routes matching 172.16.50.1/32 are installed first because they have a priority of high. Routes associated with these prefixes are installed in the routing table in the order of the specified priority of the prefix.

Topology

Figure 1 shows the sample topology.

Figure 1: Priority for Route Prefixes in the rpd InfrastructurePriority for Route Prefixes in the rpd Infrastructure

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 the configuration mode.

R1

R2

R3

Configuring Device R1

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 R1:

  1. Configure the interfaces.

  2. Assign the loopback address to the device.

  3. Configure MPLS.

  4. Configure the router ID and autonomous system of Router R1.

  5. Enable OSPF on the interfaces of Router R1.

  6. Configure LDP protocols on the interfaces.

  7. Configure BGP.

  8. Configure the policy options to prioritize the routes. The policy next-hop-self accepts routes from BGP. You configure three import routing policies: next-hop-self, ospf-prio, and prio_for_bgp. The routing policy next-hop-self accepts routes from BGP. For the ospf-prio routing policy, routes matching 172.16.25.3/32 are installed first because they have a priority of high. LDP imports routes from OSPF. For prio_for_bgp policy, routes matching 172.16.50.1/32 are installed first because they have a priority of high.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show routing-options, and show policy-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 the configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying the Priority for OSPF Routes

Purpose

Verify that the priority is set for the expected route in OSPF.

Action

On Device R1, from operational mode, run the show ospf route 172.16.25.3/32 extensive command. A priority of high is applied to OSPF route 172.16.25.3.

Meaning

The output shows priority high is applied for OSPF route 172.16.25.3.

Verifying the Priority for LDP Routes

Purpose

Verify if LDP inherits from OSPF.

Action

From operational mode, enter the show route 172.16.25.3 command to verify if LDP has inherited routes from OSPF.

From operational mode, enter the show route 172.16.25.3 extensive command to verify if LDP has inherited priority.

Meaning

The output shows that LDP inherits priority high for route 172.16.25.3 from OSPF.

Verifying the Priority for BGP Routes

Purpose

Verify that priority is set for the expected route in BGP.

Action

On Device R1, from operational mode, run the show route protocol bgp command to display the routes learned from BGP.

On Device R1, from operational mode, run the show route 172.16.50.1 extensive command. High priority is applied for BGP route 172.16.50.1.

Meaning

The output shows that priority high is applied for BGP route 172.16.50.1.