L3 · igp · draft

Static routing

Static routes and floating static routes

Installs an operator-authored next hop for a prefix, and uses a worse preference only when a better route of the same length disappears.

Presenter modeEmbed this figure

STATIC ROUTINGRFC 1812 · PROPOSED STANDARD · June 1995Administrative PreferenceRFC 1812 · PROPOSED STANDARD · June 1995Classless Inter Domain Routing (CIDR)RFC 1812 · PROPOSED STANDARD · June 1995Internet Header FormatRFC 791 · INTERNET STANDARD · September 1981

Why it exists

Dynamic protocols need neighbours, timers and a shared metric. Many edges have one uplink and one set of destinations that never change. Writing the next hop once is cheaper than running a protocol for nothing.

Router requirements treat static routing as a first-class mechanism: a prefix, a next hop, and a configurable preference against dynamic sources. Floating statics are that preference used as a backup. STATIC ROUTINGRFC 1812 · PROPOSED STANDARD · June 1995

A next hop written by hand

A router has no dynamic protocol for a remote prefix. The operator installs a static route; forwarding looks only at the destination address in the IPv4 header.

Edge has a connected LAN and an uplink. Nothing advertises 198.51.100.0/24 into this box, so without an operator entry the destination is unreachable. Host · 10.1.1.10. Edge: RIB connected + uplink only. ISP · next hop. 198.51.100.0/24.

Host · 10.1.1.10EdgeNo route to remoteRIB: connected + uplink onlyISP · next hop198.51.100.0/24203.0.113.1
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Host · 10.1.1.10host
EdgerouterRIB: connected + uplink only
ISP · next hopcloud
198.51.100.0/24zone
Host · 10.1.1.10Edgelinkup
EdgeISP · next hoplinkup · 203.0.113.1
ISP · next hop198.51.100.0/24linkup
1 / 4

Edge has a connected LAN and an uplink. Nothing advertises 198.51.100.0/24 into this box, so without an operator entry the destination is unreachable.

What changed

  • Edge: RIB → connected + uplink only
  • Emphasis: No route to remote

How it works

Forwarding reads the IPv4 Destination Address and selects the longest matching prefix. A static route is one more candidate in that table, authored by configuration rather than by a protocol. Internet Header FormatRFC 791 · INTERNET STANDARD · September 1981

When two routes cover the same prefix length, administrative preference decides. A floating static uses a worse preference so it stays unused until the preferred source withdraws. Administrative PreferenceRFC 1812 · PROPOSED STANDARD · June 1995

A longer prefix always wins over a shorter one, regardless of source. A /32 static overrides a /16 from OSPF because longest match runs before distance is compared. Classless Inter Domain Routing (CIDR)RFC 1812 · PROPOSED STANDARD · June 1995

On the wire

Constructed examples, encoded from the field table below them — not captured traffic.

IHL 5, so no options. DF is set because the sender is doing path MTU discovery — which is why a filtered ICMP turns this into a black hole rather than a retry at a smaller size.

Link layer
Ethernet with EtherType 0x0800, or whatever the medium uses to say "IPv4 follows". RFC 791
IPv4 header
Version, length, differentiated services, fragmentation control, TTL, protocol, addresses. RFC 791
Payload
Whatever the protocol field names — 1 for ICMP, 6 for TCP, 17 for UDP, 89 for OSPF, 103 for PIM. RFC 791

Configure it

Install a primary static, a floating backup, and a discard under a summary.

Cisco IOS-XE 17.12 · ISR 4451, Catalyst 9500draft

  1. ip route 198.51.100.0 255.255.255.0 203.0.113.1

    Destination prefix and next-hop address. Forwarding matches the IPv4 Destination Address against this prefix.

    RFC 1812 §7.4

  2. ip route 10.9.0.0 255.255.0.0 203.0.113.5 210

    Same-length backup with administrative distance 210 so OSPF (110) wins while present.

    Common mistake: Leaving the distance at the default (1). The static then permanently overrides the IGP.

    RFC 1812 §5.2.4.4

  3. ip route 10.9.0.0 255.255.0.0 Null0 254

    Intentional discard for holes under a summary you advertise. Prefer this over an accidental loop via default.

Verify

show ip route 198.51.100.50
Selected next hop and source (static).
show ip route static
Configured statics, including distance.

Caveats

  • Exit-interface statics on Ethernet ARP for remote destinations; prefer next-hop IP.
  • Distance values are platform conventions, not RFC constants.

When it breaks

Symptom first, because that is what you have when it happens.

  1. The static appears in the table and traceroute dies one hop past this router, or never leaves it.

    Narrow it down

    1. Confirm the next-hop address is reachable (ping / show to the next hop, not only to the destination).
    2. Check whether the next hop resolves through another static or a default that loops.
    3. On Ethernet, verify ARP for the next hop completes.

    Cause

    The route is installed against a next hop that cannot be used. Recursive resolution fails silently from the destination’s point of view.

    Fix

    Point the static at a connected next hop or a next hop that resolves through a working route. Remove recursive chains that depend on the route they are trying to support.

    Next Hop AddressRFC 1812 · PROPOSED STANDARD · June 1995
  2. The primary path is down and the backup static never takes over.

    Narrow it down

    1. Compare administrative distances of the primary source and the static for the same prefix.
    2. Confirm the primary route actually left the table — a stuck adjacency or redistributed copy can keep a “better” entry alive.
    3. Check tracking or BFD if the static is meant to withdraw when the uplink dies.

    Cause

    The floating static is not worse than what remains, or the primary source never withdrew. Distance only matters between candidates that are both present.

    Fix

    Raise the static’s distance above every remaining source of that prefix, or ensure the primary is truly gone before expecting failover.

    Administrative PreferenceRFC 1812 · PROPOSED STANDARD · June 1995
  3. A working IGP appears ignored for one destination while the rest of the table looks correct.

    Narrow it down

    1. Look for a longer prefix to that destination from any source, especially a host static.
    2. Compare prefix lengths before comparing administrative distances.
    3. Check whether a leftover troubleshooting static was left behind.

    Cause

    Longest match selected a more specific static. Distance never competed because the prefixes were different.

    Fix

    Remove or shorten the stray specific, or make it intentional and documented.

    Classless Inter Domain Routing (CIDR)RFC 1812 · PROPOSED STANDARD · June 1995
  4. A static via an Ethernet interface without a next-hop address generates ARP for remote destinations and saturates the segment.

    Narrow it down

    1. Inspect the static: exit interface only versus next-hop address.
    2. Check ARP tables for many incomplete or unexpected entries toward remote prefixes.
    3. Confirm the media is multi-access rather than true point-to-point.

    Cause

    Exit-interface statics treat the destination as on-link. On Ethernet that means ARP for every remote address.

    Fix

    Rewrite the static with an explicit next-hop IP on that interface. Reserve exit-interface form for true point-to-point links.

  5. After advertising a summary, destinations inside the hole bounce until TTL expires instead of failing fast.

    Narrow it down

    1. Compare the advertised aggregate against prefixes actually held.
    2. Check for a discard/Null route covering the summary.
    3. Trace a hole address and see whether it follows a default back out.

    Cause

    The summary claims reachability the site does not have, and without a local discard the packet follows a less-specific default.

    Fix

    Install a discard route for the summary so uncovered addresses die here.

Design notes

Prefer next-hop address over exit-interface alone on multi-access media. An exit interface without a next hop forces the router to ARP for every destination as if it were on-link.

Use discard routes under summaries you originate. An accidental gap under an advertised aggregate should fail here with a counter, not bounce toward a default.

Static routes do not detect that the far side of a path is down unless something else withdraws them. BFD or a tracked object is what turns a static into a route that can leave the table when the path dies.

Misconceptions

Static routes always beat dynamic protocols.
Only when configured with a better administrative preference for the same prefix length. Floating statics deliberately lose until the preferred source is gone. Administrative PreferenceRFC 1812 · PROPOSED STANDARD · June 1995
A better administrative distance overrides a longer prefix.
Longest match runs first. A /32 from anywhere beats a /8 with the best distance, because the two were never compared on preference. Classless Inter Domain Routing (CIDR)RFC 1812 · PROPOSED STANDARD · June 1995
If show ip route prints the static, forwarding works.
The line proves configuration and RIB presence, not that the next hop resolves or that the far path is up. Recursive failure and silent drops both look like a healthy static entry.

More walkthroughs

A worse static waits for the better route to diefailure

An OSPF-learned route and a higher-distance static share one prefix. While OSPF is up the static is present but unused; when OSPF withdraws, the static becomes the forwarding entry.

Both candidates cover 10.9.0.0/16. Preference between them is administrative: OSPF at distance 110 beats a static configured at 210 on the same prefix length. Edge: Active OSPF · AD 110, Candidate static · AD 210. OSPF path. Backup link. 10.9.0.0/16.

EdgeActive: OSPF · AD 110Candidate: static · AD 210OSPF pathBackup link10.9.0.0/16OSPF AD 110static AD 210
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
EdgerouterActive: OSPF · AD 110 · Candidate: static · AD 210
OSPF pathcloud
Backup linkcloud
10.9.0.0/16zone
EdgeOSPF pathlinkup · OSPF AD 110
EdgeBackup linklinkup · static AD 210
OSPF path10.9.0.0/16linkup
Backup link10.9.0.0/16linkup
1 / 4

Both candidates cover 10.9.0.0/16. Preference between them is administrative: OSPF at distance 110 beats a static configured at 210 on the same prefix length.

What changed

  • Edge: Active → OSPF · AD 110
  • Edge: Candidate → static · AD 210
  • Emphasis on Edge ↔ OSPF path

A next hop that resolves to nowherefailure

A static points at a next-hop address that itself has no usable route, or at an exit interface with no ARP target. The route looks installed and traffic disappears.

Configuration says 203.0.113.0/24 via 10.255.0.1. The route appears in the table. Nothing has verified that 10.255.0.1 is reachable through a connected or recursively resolved path. Edge: Static 203.0.113.0/24 → 10.255.0.1. Unresolved NH. Null / drop. 203.0.113.0/24.

EdgeStatic: 203.0.113.0/24 → 10.255.0.1Unresolved NHNull / drop203.0.113.0/24via 10.255.0.1Null0
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
EdgerouterStatic: 203.0.113.0/24 → 10.255.0.1
Unresolved NHcloud
Null / dropzone
203.0.113.0/24zone
EdgeUnresolved NHlinkup · via 10.255.0.1
EdgeNull / droplinkup · Null0
Unresolved NH203.0.113.0/24linkdown
1 / 4

Configuration says 203.0.113.0/24 via 10.255.0.1. The route appears in the table. Nothing has verified that 10.255.0.1 is reachable through a connected or recursively resolved path.

What changed

  • Edge: Static → 203.0.113.0/24 → 10.255.0.1
  • Emphasis on Edge

Terms

Longest prefix match
The forwarding rule: among all routes containing a destination, the one fixing the most bits is used. Metric and administrative distance only compare routes to the same prefix and never override this.
Administrative distance
A local, configurable preference between routing protocols offering the same prefix. It never crosses the wire and runs only after longest-prefix match has chosen the prefix.
Floating static
A static route configured with a worse administrative preference than the preferred source for the same prefix length, so it stays unused until that source withdraws.

Check yourself

  • Which IPv4 header field does a router use to select a static route?
  • A /24 OSPF route and a /32 static both cover the destination. Which wins?
  • Why configure a backup static with administrative distance 210 when OSPF is 110?
  • OSPF and a floating static both offer 10.9.0.0/16. OSPF is up. Which is used?
  • A static via 10.255.0.1 is in the table but packets vanish. What should you check next?
  • What is a discard (Null0) static under a summary for?
  • Why do connected routes usually beat statics to the same prefix?
  • A static uses only an Ethernet exit interface, no next-hop IP. What goes wrong?