Floating Static Routes and Blackhole Routes
Key Takeaways
- A floating static route is a backup static with a worse (higher) preference that installs when the primary route to the same prefix is withdrawn.
- On Huawei, higher preference means less preferred—primary statics use lower Pre; backups use higher Pre (for example 60 primary default vs 100 backup).
- Blackhole routes point matching traffic to NULL0 so the router discards packets instead of forwarding or looping them.
- Null0 statics are used for discard-on-purpose designs, summary safety (preventing loops when a summary is advertised but specifics are missing), and simple security sinks.
- Verify active versus backup behavior by checking display ip routing-table before and after primary next-hop or interface failure, and confirm Null0 entries show the discard interface.
From single statics to resilient static design
A single static route is a single point of intent—and often a single point of failure. When the primary next hop dies, you want a backup path without rediscovering the entire network by hand during the outage. Floating static routes provide that backup using preference. Separately, blackhole (Null0) routes give you a deliberate discard path when forwarding would be worse than dropping (loops, bogon space, summary holes).
Both features use the same ip route-static family you already know. The exam difference is preference direction for floating routes and NULL0 as the forwarding target for blackholes.
Floating static routes: definition
A floating static route is a static route configured with a higher preference value (less preferred) than the primary route to the same prefix. While the primary remains active and valid, the floating static stays in standby. When the primary is withdrawn (interface down, next hop unresolved, primary static removed, or dynamic primary lost), the floating static installs and carries traffic.
| Role | Typical preference idea | Example |
|---|---|---|
| Primary static | Default 60 or a low custom value | via ISP-A next hop Pre 60 |
| Floating backup | Worse than primary (e.g. 100) | via ISP-B next hop Pre 100 |
| Dynamic primary + static backup | Static Pre higher than IGP (e.g. static 100 vs OSPF 10) | OSPF carries traffic until OSPF fails |
Critical Huawei rule (read twice)
Higher preference number = less preferred = floating candidate.
Lower preference number = more preferred = primary.
If you reverse the numbers, the “backup” steals traffic permanently. This is one of the highest-yield HCIA traps because Cisco AD direction is the same (lower better), but students still invert values when they think “backup should be priority 100 meaning stronger.” On Huawei preference tables, 100 is weaker than 60.
Configuration pattern
Primary and backup toward 192.168.100.0/24:
[Huawei] ip route-static 192.168.100.0 255.255.255.0 10.0.0.2 preference 60
[Huawei] ip route-static 192.168.100.0 255.255.255.0 10.0.1.2 preference 100
You may omit preference 60 on the first line because 60 is the static default, but writing it explicitly makes lab intent obvious. The backup must include a worse preference or it ties/competes incorrectly.
Default route floating pair toward dual exits:
[Huawei] ip route-static 0.0.0.0 0.0.0.0 203.0.113.1 preference 60
[Huawei] ip route-static 0.0.0.0 0.0.0.0 198.51.100.1 preference 100
When does the backup activate?
The backup becomes active when the primary route is no longer selectable, commonly because:
- The primary’s outbound interface goes down.
- The primary next hop becomes unreachable (recursive resolution fails).
- The primary static is undone or missing after config loss.
- A dynamic primary (OSPF) is withdrawn after neighbor loss, allowing a worse-preference static to take over.
If the primary next hop remains reachable but the path beyond it is broken, a pure floating static may not fail over—static routes do not detect remote application failure. Floating statics track local validity of the route, not full end-to-end SLA. (BFD can track next hops on advanced designs; HCIA focuses on preference + interface/next-hop validity basics.)
Verification of floating behavior
<Huawei> display ip routing-table protocol static
<Huawei> display ip routing-table 192.168.100.0
Healthy primary phase:
- Active entry shows next hop 10.0.0.2 with Pre 60.
- Backup may be absent from the active table or shown inactive depending on version/display—configuration still exists in
display current-configuration.
After primary link failure:
- Active entry should move to 10.0.1.2 with Pre 100.
- Traffic follows the backup path.
Lab drill:
- Configure primary + floating backup.
pingthrough primary; traceroute confirms exit.- Shut primary interface or remove primary next hop reachability.
- Re-check routing table;
pingagain; confirm new next hop. - Restore primary; confirm Pre 60 path returns.
Floating static vs dynamic routing (design sense)
| Design | Primary | Backup |
|---|---|---|
| Dual static | Static Pre 60 | Static Pre 100 |
| IGP primary | OSPF Pre 10 | Static Pre 60 or 100 (still worse than 10) |
| Static primary, OSPF present | Static Pre 5 (forces static) | OSPF remains if static withdrawn—know your intent |
Most campus cores prefer OSPF for automatic reconvergence. Floating statics still appear at Internet edges, stub backups, and exam scenarios where only static tools are in scope.
Blackhole routes and NULL0
A blackhole route sends matching traffic to the discard interface, commonly NULL0 on Huawei. Packets that longest-match the blackhole prefix are dropped instead of being forwarded out a real transit interface.
[Huawei] ip route-static 192.168.99.0 255.255.255.0 NULL0
or with explicit preference if needed:
[Huawei] ip route-static 192.168.99.0 255.255.255.0 NULL0 preference 60
| Goal | How Null0 helps |
|---|---|
| Drop spoofed/unused space | Attract or match bogons and discard |
| Stop loops on summaries | If you advertise a summary but a component subnet is down, without Null0 traffic for missing components may follow a less specific route (even default) back toward you → loop; Null0 summary discard breaks the loop |
| Controlled sinkhole | Security response: send bad destinations to discard |
| Exam “discard” wording | Recognize NULL0 as intentional drop |
Summary + Null0 safety (conceptual HCIA story)
Imagine a router advertises summary 10.1.0.0/16 to neighbors, but only some /24s exist. A packet arrives for a missing /24 inside the summary. Without a discard route, the router might match a default and send the packet out again, eventually looping. A static
ip route-static 10.1.0.0 255.255.0.0 NULL0
ensures that if no more specific component route exists, the summary-length match on this router blackholes the packet instead of looping. More specific connected or OSPF /24s still win longest match for real subnets that exist.
That pattern—specifics for real subnets + Null0 for the summary—is a classic routing safety idea even when HCIA only sketches it at associate level.
Comparing floating statics and blackholes
| Feature | Floating static | Blackhole Null0 static |
|---|---|---|
| Purpose | Backup forwarding path | Discard matching traffic |
| Next hop | Real router IP / interface | NULL0 |
| Preference role | Higher Pre = standby | |
| Preference optional for simple blackhole | Often default 60 | |
| Success looks like | Traffic still reaches destination via backup | Traffic stops (timeout / unreachable) |
| Failure mode if misused | Backup never activates or activates early | Accidental sink of production prefixes |
Misconfiguring a Null0 route for a live user subnet is a self-inflicted outage: the route may look “perfect” in the table while users blackhole. Always verify longest match impact before adding broad Null0 prefixes.
Combined exam scenario
A branch has:
- Primary default via MPLS next hop Pre 60
- Floating default via Internet CE Pre 120
- Null0 for RFC1918 space that should never leave the branch toward the Internet (policy example)
[Branch] ip route-static 0.0.0.0 0.0.0.0 10.255.0.1 preference 60
[Branch] ip route-static 0.0.0.0 0.0.0.0 192.0.2.1 preference 120
[Branch] ip route-static 10.0.0.0 255.0.0.0 NULL0
Interpretation skills:
- Normal Internet-bound traffic uses default via
10.255.0.1. - If that next hop dies, default floats to
192.0.2.1. - Packets to
10.0.0.0/8that do not match a longer local/remote enterprise route can hit Null0—dangerous if you still need other10/8corporate routes; in real design you only blackhole prefixes you truly want discarded. The exam cares that you know what Null0 does, not that you blindly blackhole all RFC1918.
Troubleshooting matrix
| Symptom | Likely cause | Check |
|---|---|---|
| Backup never used when primary cable pulled | Backup Pre not worse, or primary still resolves | Pre values; next-hop reachability |
| Backup used always | Backup Pre better (lower) than primary | Swap preferences |
| Both statics same Pre | Undefined/tie behavior risk | Differentiate Pre |
| Users offline after Null0 add | Longest match hits Null0 for live space | More specifics? Wrong mask? |
| Loop after summarization | Missing Null0 or missing specifics | Summary design + discard |
| Static missing after reboot | Not saved | save / saved-config |
Commands recap for this chapter close-out
[Huawei] ip route-static <dest> <mask> <next-hop> preference <value>
[Huawei] ip route-static <dest> <mask> NULL0
[Huawei] undo ip route-static <dest> <mask> <next-hop> preference <value>
<Huawei> display ip routing-table
<Huawei> display ip routing-table protocol static
Exam traps
- Setting the backup to a lower preference so it becomes primary forever.
- Believing floating statics detect remote server failure without tracking.
- Confusing Null0 blackhole with firewall ACL (related outcomes, different mechanisms).
- Forgetting longest match: a /32 host route still beats a Null0 /16 for that host.
- Mixing preference with cost: floating uses preference, not OSPF cost, for static standby.
- Recursive next-hop failure on both primary and backup—failover needs a valid backup next hop.
Lab checklist
- Configure dual statics with Pre 60 and Pre 100 to the same prefix.
- Confirm only primary is active; test traffic.
- Fail primary next hop/interface; confirm backup activates.
- Restore primary; confirm revert.
- Add a Null0 route to a lab-only test prefix; confirm packets to it discard while other prefixes work.
- Remove Null0 with matching
undo ip route-static ... NULL0.
Chapter synthesis
You now connect the full static story: RIB/FIB and longest match decide what a packet hits; preference chooses among same-prefix sources; ip route-static installs manual paths and defaults; floating preference builds backup; NULL0 discards on purpose. The next chapter (OSPF) replaces many manual lines with dynamic discovery—but every OSPF table you read still obeys the same longest-match and preference foundations established here.
On Huawei VRP, which static route acts as a floating backup to a primary static with preference 60 for the same prefix?
What does a static route to NULL0 accomplish?
Why might an engineer configure ip route-static 10.1.0.0 255.255.0.0 NULL0 on a router that also has more specific routes for some 10.1.x.0/24 subnets?
Primary static route next hop fails and becomes unreachable. A floating static for the same prefix exists with a higher preference and a valid alternate next hop. What should happen?