Example: Controlling Static Route Selection
This example shows how to control static route selection.
Requirements
Before you begin:
- Establish basic connectivity. See the Getting Started Guide for your device.
- 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

Configuration
CLI Quick Configuration
To quickly configure a static route selection, copy the following commands and paste them into the CLI:
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:
- 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
- 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
- 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
- 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 (...).
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
- Junos OS Feature Support Reference for SRX Series and J Series Devices
- Understanding Static Route Preferences and Qualified Next Hops
- Static Routing Configuration Overview
- Verifying the Static Route Configuration
Hide Navigation Pane
Show Navigation Pane
Download
SHA1