Technical Documentation

Configuring Static Routes

The routing device uses dynamic routes to learn how to reach network destinations. Dynamic routes are determined from the information exchanged by the routing protocols and, as the name implies, the routes might change as network conditions change and these changes are discovered by the routing protocols. You can configure static (nonchanging) routes to some network destinations. The routing device uses static routes when it does not have a route to a destination that has a better (lower) preference value, when it cannot determine the route to a destination, or when it is forwarding unroutable packets.

Static routes are used when the network connects to a routing device or other system outside the network and either that system cannot run a routing protocol or you do not want to run a routing protocol on it. In these situations, a static route is created from an edge routing device to the outside system and then the edge routing device redistributes the static route to IGP.

A static route is installed in the routing table only when the route is active; that is, the list of next-hop routing devices configured for that route contains at least one next hop on an operational interface.

You can add the same routes to more than one routing table.

To configure static routes in the default IPv4 routing table (inet.0), include the static statement:

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;}<local-address ip-address>;minimum-interval milliseconds;minimum-receive-interval milliseconds;multiplier number;neighbor address;minimum-receive-ttl number;no-adaptation;transmit-interval {threshold milliseconds;minimum-interval milliseconds;}version (1 | automatic);}lsp-next-hop lsp-name {metric metric;preference preference;}next-hop address;next-hop options;p2mp-lsp-next-hop {metric metric;preference preference;}qualified-next-hop address {metric metric;preference preference;}static-options;}}

For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.

To configure static routes in one of the other routing tables, to explicitly configure static routes in the default IPv4 route table (inet.0), or to explicitly configure static routes in the primary IPv6 routing table (inet6.0), include the static statement:

rib routing-table-name {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;}<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);}lsp-next-hop lsp-name {metric metric;preference preference;}next-hop address;next-hop options;p2mp-lsp-next-hop {metric metric;preference preference;}qualified-next-hop address {metric metric;preference preference;}static-options;}}}

For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.

Note: You cannot configure static routes for the IPv4 multicast routing table (inet.1) or the IPv6 multicast routing table (inet6.1).

The static statement consists of two parts:

  • 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.

    Note: 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.

The following topics provide more information about configuring static routes:

Related Topics


Published: 2010-07-02

Help
|
My Account
|
Log Out