5.2 Static & Default Routing

Key Takeaways

  • Static routes are configured under 'routing-options static route' and have a default route preference of 5 in Junos.
  • Common next-hop types are an IP address, an egress interface, and the actions discard (silent drop) and reject (drop with ICMP unreachable).
  • The default route is 0.0.0.0/0 for IPv4 and ::/0 for IPv6; it is the least specific match and is used when no more specific route exists.
  • Qualified next hops let you attach a different preference or metric to specific next hops of one static route, which is how floating static routes are built.
  • A floating static route uses a raised preference so it stays inactive until a preferred dynamic or primary route is withdrawn.
Last updated: May 2026

Why Static Routing Is Tested

Static routing is the most predictable routing tool in Junos and a heavily tested part of the Routing Fundamentals domain. JNCIA-Junos expects you to know the configuration hierarchy, the next-hop options, the default route concept, and how preference makes a static route act as a backup.

Static Route Configuration

Static routes live under the [edit routing-options static] hierarchy. Each route specifies a destination prefix and at least one next hop.

[edit routing-options]
static {
    route 192.0.2.0/24 next-hop 198.51.100.1;
    route 10.10.0.0/16 next-hop ge-0/0/3.0;
}

You can also configure IPv6 static routes under rib inet6.0 or directly with an IPv6 prefix, since they are placed in inet6.0. By default a Junos static route has a route preference of 5, which is lower (more trusted) than every dynamic protocol default but higher than direct and local routes.

Next-Hop Types

Junos supports several next-hop forms. You must be able to recognize each on the exam.

Next-hop valueBehavior
IP address (for example 198.51.100.1)Forward to that reachable next-hop router
Egress interface (for example ge-0/0/3.0)Forward out that interface (typical on point-to-point links)
discardSilently drop matching packets, no ICMP sent
rejectDrop matching packets and send an ICMP unreachable to the source
next-table inet.0Resolve the lookup in another routing table

discard is useful for null routing and aggregation black-holes; reject is friendlier for troubleshooting because the source learns the destination is unreachable. Both prevent forwarding loops for unreachable space.

The Default Route

A default route is the route of last resort, used only when no more specific prefix matches. Because it is the least specific possible prefix, it always loses longest-prefix match to any real route.

Address familyDefault route prefix
IPv40.0.0.0/0
IPv6::/0
[edit routing-options]
static {
    route 0.0.0.0/0 next-hop 203.0.113.1;
}

This is the most common way an access or edge device reaches the rest of the network or the internet without running a dynamic protocol.

Qualified Next Hops

A qualified next hop lets a single static route carry more than one next hop, each with its own preference or metric. This is how Junos expresses primary and backup paths for the same prefix without two separate route statements.

[edit routing-options]
static {
    route 192.0.2.0/24 {
        next-hop 198.51.100.1;
        qualified-next-hop 198.51.100.65 {
            preference 7;
        }
    }
}

Here the primary next hop keeps preference 5; the qualified next hop has preference 7, so it is only used when the primary next hop becomes unreachable.

Floating Static Routes

A floating static route is a static route configured with a deliberately raised preference so that it stays inactive while a preferred route (often a dynamic protocol route) is present. If the preferred route is withdrawn, the floating static becomes active and provides a backup path.

[edit routing-options]
static {
    route 172.16.0.0/16 {
        next-hop 203.0.113.9;
        preference 250;
    }
}

With preference 250, this static route loses to OSPF (10), RIP (100), and BGP (170) for the same prefix, so it floats unused until those routes disappear. Floating statics are a frequent JNCIA-Junos scenario question.

Useful Route Attributes

AttributeEffect on a static route
preferenceSets route preference (default 5); raise it to create a backup/floating route
metricTiebreaker among same-preference routes/next hops
qualified-next-hopPer-next-hop preference or metric on one route
no-readvertiseMarks the route so it is not redistributed by policy
discard / rejectDrop actions instead of forwarding
Test Your Knowledge

What is the default route preference of a static route in Junos?

A
B
C
D
Test Your Knowledge

Which static route next-hop action silently drops matching packets without sending an ICMP unreachable message to the source?

A
B
C
D
Test Your Knowledge

An engineer configures a static route for 172.16.0.0/16 with 'preference 250' while OSPF also advertises 172.16.0.0/16. What is the result?

A
B
C
D