Example: Controlling Static Routes in Routing and Forwarding Tables
This example shows how to control static routes in the routing and forwarding tables.
Requirements
Before you begin:
- Establish basic connectivity. See the Getting Started Guide for your device.
- Configure network interfaces. See Junos OS Interfaces Configuration Guide for Security Devices.
- Control static route selection. See Example: Controlling Static Route Selection.
Overview
This example shows how to control static routes in routing and forwarding tables.
- Specify that the 192.168.47.5/32 route has to be retained in the forwarding table after the routing process shuts down. By default, static routes are not retained.
- Specify that the static route should not be readvertised. By default, static routes are eligible to be readvertised.
- Specify that the static route has to be included in the routing table whether the route is active or not. By default, passive routes are not included in the routing table.
Configuration
CLI Quick Configuration
To quickly configure static routes in routing and forwarding tables, copy the following command and paste it 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 routes in routing and forwarding tables:
- Create a static route.[edit]user@host# edit routing-options static route 192.168.47.5/32
- Retain the static route in the forwarding
table.[edit routing-options static route 192.168.47.5/32]user@host# set retain
- Prevent the static route from being readvertised.[edit routing-options static route 192.168.47.5/32]user@host# set no-readvertise
- Include the static route in the routing
table.[edit routing-options static route 192.168.47.5/32]user@host# set passive
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 the static route configuration by displaying the routing table and checking its contents.
Action
From operational mode, enter the show route terse command.
Related Topics
- Junos OS Feature Support Reference for SRX Series and J Series Devices
Hide Navigation Pane
Show Navigation Pane
Download
SHA1