Description

Static routes are routes that are manually configured and entered into the routing table. This article provides information about configuring and verifying static routes. 


The switch uses static routes:

  • When the switch does not have a route to a destination that has a better (lower) preference value. The preference is an arbitrary value in the range from 0 through 255 that the software uses to rank routes received from different protocols, interfaces, or remote systems. The routing protocol process generally determines the active route by selecting the route with the lowest preference value. In the given range, 0 is the lowest and 255 is the highest.
  • A static route with a more specific mask like /32 will be preferred over a route with a more open mask like /8.
  • When the switch cannot determine the route to a destination.
  • When the switch is forwarding unroutable packets.

Solution

This section contains the following:

J-Web Configuration

For information about configuring static routes, see Configuring Static Routing (J-Web Procedure) .

For information about configuring static routes (EX): https://www.juniper.net/documentation/us/en/software/jweb-ex/jweb-ex-application-package/topics/task/static-routing-ex-series-j-web.html

CLI Configuration

For information about configuring static routes, see Examples: Configuring Static Routes

To configure basic static route options using the CLI:
  • To configure the switch's default gateway:
    [edit]user@switch# set routing–options static route 0.0.0.0/0 next-hop 10.0.1.1
  • To configure a static route and specify the next address to be used when routing traffic to the static route:
    [edit]user@switch# set routing-options static route 198.51.100.0/24 next-hop 10.0.0.2
  • To always keep the static route in the forwarding table:
    [edit]user@switch# set routing-options static route 198.51.100.0/24 retain
  • To prevent the static route from being readvertised:
    [edit]user@switch# set routing-options static route 198.51.100.0/24 no-readvertise
  • To remove inactive routes from the forwarding table:
    [edit]user@switch# set routing-options static route 198.51.100.0/24 active

Technical Documentation

Protocol-Independent Routing Properties Feature Guide for Security Devices

Verification

To review a summary of the routes in the routing table, use the following operational mode command:

user@host> show route terse

For information about verifying static route configuration, see show route terse . Note the next hop needs to be up and reachable for the route to show on the routing table and forwarding table.

Checking the Routing Tables:

user@B> show route protocol static

inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:31:24
                    > to 10.0.1.1 via ge-1/2/0.1

To verify the static routes are working, use the below operational mode command:

user@B> ping 192.168.47.5
PING 192.168.47.5 (192.168.47.5): 56 data bytes
64 bytes from 192.168.47.5: icmp_seq=0 ttl=64 time=156.126 ms
64 bytes from 192.168.47.5: icmp_seq=1 ttl=64 time=120.393 ms
64 bytes from 192.168.47.5: icmp_seq=2 ttl=64 time=175.361 ms


Modification History

08/11/2023_Modified_added EX/QFX products