Example: Controlling Static Route Selection

This example shows how to control static route selection.

Requirements

Before you begin:

  1. Establish basic connectivity. See the Getting Started Guide for your device.
  2. Configure network interfaces. See the Junos OS Interfaces Configuration Guide for Security Devices.

Overview

In this example, the static route 192.168.47.5/32 has two possible next hops. Because of the links between those next-hop hosts, host 10.10.10.7 is the preferred path. See Figure 1.

Figure 6: Controlling Static Route Selection

Image g015024.gif

Configuration

CLI Quick Configuration

To quickly configure a static route selection, copy the following commands and paste them into the CLI:

[edit]set routing-options static route 192.168.47.5 next-hop 10.10.10.10 preference 7set routing-options static route 192.168.47.5 qualified-next-hop 10.10.10.7 preference 6

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode.

To control static route selection:

  1. Configure a static route and set the next-hop address.
    [edit]user@host# set routing options static route 192.168.47.5 next-hop 10.10.10.10
  2. Set the next-hop preference.
    [edit routing options static]user@host# set route 192.168.47.5 next-hop 10.10.10.10 preference 7
  3. Set the qualified next-hop address.
    [edit routing options static]user@host# set route 192.168.47.5 qualified-next-hop 10.10.10.7
  4. Set the qualified next-hop preference.
    [edit routing options static]user@host# set route 192.168.47.5 qualified-next-hop 10.10.10.7 preference 6

Results

From configuration mode, confirm your configuration by entering the show routing-options static command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

For brevity, this show routing-options static command output includes only the configuration that is relevant to this example. Any other configuration on the system has been replaced with ellipses (...).

[edit]user@host# show routing-options static...route 192.168.47.5/32 {next-hop 10.10.10.10;qualified-next-hop 10.10.10.7 {preference 6;}preference 7;}

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

Verification

To confirm that the configuration is working properly, perform this task:

Verifying the Static Route Configuration

Purpose

Verify that the device is configured correctly for controlling a static route selection.

Action

From operational mode, enter the show route terse command.

Related Topics