static (Routing Options)
Syntax
static { defaults { static-options; } rib-group group-name; route destination-prefix { bfd-liveness-detection { authentication { algorithm algorithm-name; key-chain key-chain-name; loose-check; } detection-time { threshold milliseconds; } description description; local-address ip-address; minimum-interval milliseconds; minimum-receive-interval milliseconds; minimum-receive-ttl number; multiplier number; neighbor address; no-adaptation; transmit-interval { threshold milliseconds; minimum-interval milliseconds; } version (1 | automatic); } next-hop address; next-hop options; qualified-next-hop address { bfd-liveness-detection { authentication { algorithm (keyed-md5 | keyed-sha-1 | meticulous-keyed-md5 | meticulous-keyed-sha-1 | simple-password); key-chain key-chain-name; loose-check; } detection-time { threshold milliseconds; } holddown-interval milliseconds; minimum-interval milliseconds; minimum-receive-interval milliseconds; multiplier number; no-adaptation; transmit-interval { minimum-interval milliseconds; threshold milliseconds; } version (1 | automatic); } metric metric; preference preference; } static-options; spring-te-lsp-next-hop } }
Hierarchy Level
[edit logical-systems logical-system-name routing-instances routing-instance-name routing-options], [edit logical-systems logical-system-name routing-options], [edit logical-systems logical-system-name routing-options rib routing-table-name], [edit routing-instances routing-instance-name routing-options], [edit routing-options], [edit routing-options rib routing-table-name]
Description
Configure static routes to be installed in the
routing table. You can specify any number of routes within a single static
statement, and you can specify any number of static options in the configuration.
Options
defaults—(Optional) Specify global
static route options. These options only set default attributes inherited
by all newly created static routes. These are treated as global defaults
and apply to all the static routes you configure in the static
statement.
Specifying the global static route options does not create default routes. These options only set default attributes inherited by all newly created static routes.
route—Configure individual static routes. In
this part of the static
statement, you optionally can configure
static route options. These options apply to the individual destination
only and override any options you configured in the defaults part of the static
statement.
destination-prefix/prefix-length—destination-prefix is the network portion of the IP address, and prefix-length is the destination prefix length.
When you configure an individual static route in the route part of the static
statement, specify the destination
of the route (in route destination-prefix) in one of the following ways:
network/mask-length, where network is the network portion of the IP address and mask-length is the destination prefix length.
default if this is the default route to the destination. This is equivalent to specifying an IP address of 0.0.0.0/0.
Note:IPv4 packets with a destination of 0.0.0.0 (the obsoleted limited broadcast address) and IPv6 packets with a destination of 0::0 are discarded by default. To forward traffic destined to these addresses, you can add a static route to 0.0.0.0/32 for IPv4 or 0::0/128 for IPv6.
nsap-prefix—nsap-prefix is the network service access point (NSAP) address for ISO.
next-hop address—Reach the next-hop routing device by specifying an IP address, an interface name, or an ISO network entity title (NET).
IPv4 or IPv6 address of the next hop to the destination, specified as:
IPv4 or IPv6 address of the next hop
Interface name (for point-to-point interfaces only)
address or interface-name to specify an IP address of a multipoint interface or an interface name of a point-to-point interface.
Note:If an interface becomes unavailable, all configured static routes on that interface are withdrawn from the routing table.
Note:Load balancing is not supported on management and internal Ethernet (fxo) interfaces because this type of interface cannot handle the routing process. On fxp interfaces, you cannot configure multiple next hops and enable load balancing.
next-hop options—Additional information for how to manage forwarding of packets to the next hop.
discard—Do not forward packets addressed to this destination. Instead, drop the packets, do not send ICMP (or ICMPv6) unreachable messages to the packets’ originators, and install a reject route for this destination into the routing table.
iso-net—Reach the next-hop routing device by specifying an ISO NSAP.
-
next-table routing-table-name—Name of the next routing table to the destination.
If you use the next-table action, the configuration must include a term qualifier that specifies a different table than the one specified in the next-table action. In other words, the term qualifier in the
from
statement must exclude the table in the next-table action. In the following example, the first term contains rib vrf-customer2.inet.0 as a matching condition. The action specifies a next-hop in a different routing table, vrf-customer1.inet.0. The second term does the opposite by using rib vrf-customer1.inet.0 in the match condition and vrf-customer2.inet.0 In the next-table action.term 1 { from { protocol bgp; rib vrf-customer2.inet.0; community customer; } then { next-hop next-table vrf-customer1.inet.0; } } term 2 { from { protocol bgp; rib vrf-customer1.inet.0; community customer; } then { next-hop next-table vrf-customer2.inet.0; } }
Note:Within a routing instance, you cannot configure a static route with the
next-table inet.0
statement if any static route in the main routing instance is already configured with thenext-table
statement to point to the inet.0 routing table of the routing instance. For example, if you configure on the main routing instance a static route 192.168.88.88/32 with thenext-table test.inet.0
statement and the routing instance test is also configured with a static route 192.168.88.88/32 with thenext-table inet.0
statement, the commit operation fails. Instead, you must configure a routing table group both on the main instance and on the routing instance, which enables you to install the static route into both routing tables.Note:With the fix for PR 1383419, configuring a static route with a next-table action on QFX5xxx/EX4xxx switches results in software forwarding when the prefix length is less than 16 bits for IPv4 or 64 bits for IPv6. To avoid possible performance impact you should configure multiple static routes with prefixes equal to or longer than 16 and 64 bits for IPv6 and IPv6, respectively
receive—Install a route for this next-hop destination into the routing table.
The receive option forces the packet to be sent to the Routing Engine.
The receive option can be useful in the following cases:
For receiving MPLS packets destined to a VRF instance's loopback address
For receiving packets on a link's subnet address, with zeros in the host portion of the address
reject—Do not forward packets addressed to this destination. Instead, drop the packets, send ICMP (or ICMPv6) unreachable messages to the packets’ originators, and install a reject route for this destination into the routing table.
static-options—(Optional under route) Additional information about static routes, which is included with the route when it is installed in the routing table.
You can specify one or more of the following in static-options. Each of the options is explained separately.
(active | passive);
as-path <as-path> <origin (egp | igp | incomplete)> <atomic-aggregate> <aggregator as-number in-address>;
community [ community-ids ];
(install | no-install);
(metric | metric2 | metric3 | metric4) value <type type>;
(preference | preference2 | color | color2) preference <type type>;
(readvertise | no-readvertise);
(resolve | no-resolve);
(retain | no-retain);
tag metric type number;
The remaining statements are explained separately. See CLI Explorer.
Required Privilege Level
routing—To view this statement in the configuration.
routing-control—To add this statement to the configuration.
Release Information
Statement introduced before Junos OS Release 7.4.
Support for BFD authentication introduced in Junos 9.6.
Support for BFD authentication introduced in Junos 9.6 for EX Series switches.