Mastering Static Routing and Floating Static Routes in Juniper Networks

Routing lies at the heart of every network determining how packets find their path from one network to another. While dynamic routing protocols such as OSPF or BGP automatically exchange routing information, static routing offers simplicity, control, and predictability, making it ideal for smaller networks and testing environments.

In this blog, we’ll explore static routing concepts, configuration steps, and floating static routes using Juniper routers with example topologies.

What Is Static Routing?

A static route is a manually defined path that tells a router exactly where to send traffic for a specific destination network. Unlike dynamic routing, which automatically updates routes when the network changes, static routes must be manually configured or adjusted.

In static routing:

  • Routers use these fixed routes to forward traffic without relying on routing updates from neighbors.
  • Routers use these fixed routes to forward traffic without relying on routing updates from neighbors.

Basic Static Route Configuration

Let’s start with a simple topology between R1 and R2:

R1 has a loopback 1.1.1.1/32
R2 has a loopback 2.2.2.2/32

Configuration on R1:
set routing-options static route 2.2.2.2/32 next-hop 192.168.0.2

This tells R1 that to reach 2.2.2.2, packets should go via 192.168.0.2 (R2’s interface).

Reject and Discard Routes

Sometimes, you may want to intentionally block or drop traffic for a certain prefix. Reject and discard routes allow administrators to do that with control.

Example:
set routing-options static route 2.2.2.3/32 reject
or
set routing-options static route 2.2.2.3/32 discard

  • Reject: sends an ICMP unreachable message back to the sender.
  • Discard: silently drops the packet without notification.

Dual Paths and Qualified Next-Hops

When you have two possible links between routers, you can configure primary and backup paths using the qualified-next-hop feature. This ensures automatic failover if the primary route becomes unavailable.

Configuration on R1:
set routing-options static route 2.2.2.2/32 next-hop 192.168.0.2
set routing-options static route 2.2.2.2/32 qualified-next-hop 192.168.0.6 preference 150

The primary route uses 192.168.0.2 (preference 5 by default), while the backup route uses 192.168.0.6 with a higher preference (150), meaning it activates only if the primary fails.

Floating Static Routes Explained

A floating static route is a static route configured with a higher administrative distance (preference) than a dynamic route. It ‘floats’ below the dynamic route and only becomes active when the dynamic route is unavailable.

Why use floating static routes?

  • Provide backup path redundancy.
  • Maintain connectivity during dynamic routing failures.
  • Increase network reliability for critical destinations.

Example:
set routing-options static route 2.2.2.2/32 next-hop 192.168.0.2 preference 180
If OSPF is active for the same prefix, the OSPF route (preference 10) will be used. If OSPF fails, this static route (preference 180) will take over automatically.

Testing Route Failover

In lab environments, you can deactivate a primary static route and check how the backup activates:
deactivate routing-options static route 2.2.2.2/32 next-hop
commit
run show route protocol static

You’ll see the backup route (qualified-next-hop) become active.

Using the ‘resolve’ Keyword

In more complex setups, especially with OSPF areas, the ‘resolve’ keyword allows Junos to look up the next-hop using another route.

Example:
set routing-options static route 3.3.3.3/32 next-hop 192.168.1.32 resolve
This means: ‘Use 192.168.1.32 as the next-hop if it can be resolved through another known route.’

Verification and Troubleshooting

Common Junos commands for static route verification:

run show route protocol static
run ping <destination-ip>
run traceroute <destination-ip>
  • Static/0 or Static/150 shows the preference value.
  • A route marked with * means it’s active and installed in the forwarding table.

Key Takeaways

  1. Static routes are manually configured and ideal for stable paths.
  2. Reject/discard routes help control unwanted traffic.
  3. Qualified next-hops provide simple redundancy between links.
  4. Floating static routes act as backup routes behind dynamic ones.
  5. The ‘resolve’ keyword enables indirect next-hop resolution.
  6. Always verify with ‘show route protocol static’ to confirm active paths.

Conclusion

Static routing remains a foundational skill for network engineers. Understanding how to configure primary, backup, and floating static routes ensures your network maintains reliability and resilience even when dynamic protocols fail.

By combining clear structure, route preferences, and proper verification, you can design robust networks that stay online under any condition.

Author

Leave a Comment

Your email address will not be published. Required fields are marked *