Configuring Static Routes with a Configuration Editor
To configure static routes on the device, you must perform the following tasks marked (Required).
- Configuring a Basic Set of Static Routes (Required)
- Controlling Static Route Selection (Optional)
- Controlling Static Routes in the Routing and Forwarding Tables (Optional)
- Defining Default Behavior for All Static Routes (Optional)
For information about using the J-Web and CLI configuration editors, see the J-Web Interface User Guide and the JUNOS CLI User Guide.
Configuring a Basic Set of Static Routes (Required)
Customer routes that are connected to stub networks are often configured as static routes. Figure 71 shows a sample network.
Figure 71: Customer Routes Connected to a Stub Network
To configure customer routes as static routes, like the ones in Figure 71, follow these steps on the device to which the customer routes are connected:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 148.
- If you are finished configuring the router, commit the configuration.
- Go on to one of the following procedures:
- To manually control static route selection, see Controlling Static Route Selection (Optional).
- To determine how static routes are imported into the routing and forwarding tables, see Controlling Static Routes in the Routing and Forwarding Tables (Optional).
- To define default properties for static routes, see Defining Default Behavior for All Static Routes (Optional).
- To check the configuration, see Verifying the Static Route Configuration.
Table 148: Configuring Basic Static Routes
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the Static level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit routing-options static |
Add the static route 192.168.47.5/32, and define the next-hop address 10.10.10.10. |
| Define the static route and set the next-hop address: set route 192.168.47.5 next-hop 10.10.10.10 |
Controlling Static Route Selection (Optional)
When multiple next hops exist for a single static route (see Figure 72), you can specify how traffic is to be routed to the destination.
Figure 72: Controlling Static Route Selection
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. To configure the static route 192.168.47.5/32 with two next hops and give preference to host 10.10.10.7, follow these steps:
- Navigate to the top of the configuration hierarchy in either the J-Web or the CLI configuration editor.
- Perform the configuration tasks described in Table 149.
- If you are finished configuring the router, commit the configuration.
- Go on to one of the following procedures:
- To determine how static routes are imported into the routing and forwarding tables, see Controlling Static Routes in the Routing and Forwarding Tables (Optional).
- To define default properties for static routes, see Defining Default Behavior for All Static Routes (Optional).
- To check the configuration, see Verifying the Static Route Configuration.
Table 149: Controlling Static Route Selection
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the Static level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit routing-options static |
Add the static route 192.168.47.5/32, and define the next-hop address 10.10.10.10. |
| Define the static route and set the next-hop address: set route 192.168.47.5 next-hop 10.10.10.10 |
Set the preference for the 10.10.10.10 next hop to 7. |
| Set the preference to 7: set route 192.168.47.5 next-hop 10.10.10.10 preference 7 |
Define the qualified next-hop address 10.10.10.7. |
| Set the qualified-next-hop address: set route 192.168.47.5 qualified-next-hop 10.10.10.7 |
Set the preference for the 10.10.10.7 qualified next hop to 6. |
| Set the preference to 6: set route 192.168.47.5 qualified-next-hop 10.10.10.7 preference 6 |
Controlling Static Routes in the Routing and Forwarding Tables (Optional)
Static routes have a number of attributes that define how they are inserted and maintained in the routing and forwarding tables. To customize this behavior for the static route 192.168.47.5/32, perform these steps:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 150.
- If you are finished configuring the router, commit the configuration.
- Go on to one of the following procedures:
- To define default properties for static routes, see Defining Default Behavior for All Static Routes (Optional).
- To check the configuration, see Verifying the Static Route Configuration.
Table 150: Controlling Static Routes in the Routing and Forwarding Tables
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the 192.168.47.5/32 level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit routing-options static route 192.168.47.5/32 |
Specify that the route is to be retained in the forwarding table after the routing process shuts down. By default, static routes are not retained. | Next to Retain, select the Yes check box. | Set the retain attribute: set retain |
Specify that the static route is not to be readvertised. By default, static routes are eligible to be readvertised. | Next to Readvertise, select the No check box. | Set the no-readvertise attribute: set no-readvertise |
Specify that the static route is 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. |
| Set the passive attribute: set passive |
Defining Default Behavior for All Static Routes (Optional)
Attributes that define static route behavior can be configured either at the individual route level or as a default behavior that applies to all static routes. In the case of conflicting configuration, the configuration at the individual route level overrides static route defaults. To configure static route defaults, perform these steps:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 151.
- If you are finished configuring the router, commit the configuration.
- To check the configuration, see Verifying the Static Route Configuration.
Table 151: Defining Static Route Defaults
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the Defaults level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit routing-options static defaults |
Specify that the route is to be retained in the forwarding table after the routing process shuts down. By default, static routes are not retained. |
| Set the retain attribute: set retain |
Specify that the static route is not to be readvertised. By default, static routes are eligible to be readvertised. |
| Set the no-readvertise attribute: set no-readvertise |
Specify that the static route is 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. |
| Set the passive attribute: set passive |