Mental model
A router only knows two kinds of networks:
- Directly attached — networks on one of its own interfaces. Learned automatically when you configure an IP + mask on an interface.
- Reachable through some other router — has to be told how to get there.
Static routing is the “telling” — manually configured entries.
Three legitimate use cases for static routing in 2026:
| Scenario | Why static fits |
|---|---|
| Tiny networks (≤3 routers) | OSPF/EIGRP overhead isn’t worth it |
| Stub networks (branch with one path out) | No alternative to choose between — dynamic routing buys nothing |
| Default routes | Catch-all to the internet — no dynamic protocol expresses this naturally |
For anything bigger than ~5 routers with redundant paths, use a dynamic protocol. Static routing doesn’t recover from failures by itself unless you’ve layered a floating static or scripted reconvergence.
How a static route enters the routing table
Three conditions must all be true for a static route to appear in show ip route:
- You configured it with
ip route .... - The next-hop is reachable. The router must have a route to the next-hop IP (or the exit interface must be
up/up). - No higher-priority route exists for the same prefix at a better (lower) AD.
If you write a static route but it doesn’t show in the route table, it’s almost always condition 2: the next-hop isn’t reachable. Test with ping <next-hop> from the router.
Three syntaxes — which to use when
Syntax 1 — next-hop IP
R1(config)# ip route 10.2.0.0 255.255.255.0 10.0.1.2
Router does an ARP lookup for 10.0.1.2 to resolve the next-hop’s MAC, then forwards.
Use on: Ethernet, GRE tunnels, any multi-access medium where ARP makes sense.
Syntax 2 — exit interface only
R1(config)# ip route 10.2.0.0 255.255.255.0 Serial0/0/0
Router sends packets directly out the named interface — no ARP needed (point-to-point links).
Use on: Serial / HDLC / PPP / point-to-point sub-interfaces. Never on plain Ethernet (causes catastrophic ARP for every destination IP).
Syntax 3 — fully-specified (both)
R1(config)# ip route 10.2.0.0 255.255.255.0 GigabitEthernet0/0 10.0.1.2
Most explicit — tells the router both the exit interface and the next-hop. Helpful in scenarios with multiple paths or when you want to avoid recursive lookups.
Use on: any scenario where you want explicitness, especially when the next-hop is reachable through multiple interfaces.
The three-way comparison
| Form | Exit-interface ARP overhead | Recursive lookup | Recommended for |
|---|---|---|---|
| Next-hop only | One ARP per next-hop (cached) | Yes (find next-hop in routing table first) | Ethernet, most cases |
| Exit-interface only | No ARP (point-to-point) | No | Serial / PPP / GRE point-to-point |
| Fully-specified | One ARP cached | No | Multi-interface routers, explicit production config |
Default route — the catch-all
A default route matches anything that doesn’t match a more specific route:
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
Read aloud: “for any destination, send to 203.0.113.1.”
This is the route that points to the internet on every home/edge router. Without it, any traffic to an unknown destination is dropped (and the router may even send an ICMP unreachable back).
Verify with:
R1# show ip route 0.0.0.0
Gateway of last resort is 203.0.113.1 to network 0.0.0.0
The phrase “Gateway of last resort” in show output is your hint that a default route exists. If missing, no default is set.
Default routes can be:
- Static —
ip route 0.0.0.0 0.0.0.0 <next-hop> - OSPF —
default-information originateinjects a default into OSPF - EIGRP — redistribute a static default into EIGRP
- BGP — receive a default from your ISP (the most common in service-provider environments)
Floating static — the backup route
A floating static is a static route with artificially high administrative distance so it’s only used if the primary path fails:
! Primary path: OSPF learns 10.2.0.0/24 (AD 110)
! Backup path: static with AD 200
R1(config)# ip route 10.2.0.0 255.255.255.0 10.99.99.2 200
| Time | OSPF state | Active route |
|---|---|---|
| Normal | Up | OSPF (AD 110) wins |
| OSPF link fails | Down | Static (AD 200) takes over |
| OSPF recovers | Up | OSPF (AD 110) wins again |
The floating static “floats” — present in the config always, but only inserted into the routing table when the better source disappears.
Use cases:
- Backup WAN link (primary = MPLS via OSPF; backup = LTE via static)
- Failover to a different egress router
- Maintenance-window simulation (administratively bump primary AD, watch static take over)
Critical: specify the AD. Static’s default AD is 1 — beats everything. A “backup” static with default AD = 1 becomes the primary path.
Administrative Distance — the AD ladder
When the same prefix is learned from multiple sources, the router compares AD first. Lower AD wins.
| Source | AD |
|---|---|
| Connected | 0 |
| Static | 1 |
| EIGRP summary route | 5 |
| External BGP (eBGP) | 20 |
| Internal EIGRP | 90 |
| IGRP (legacy) | 100 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| External EIGRP | 170 |
| Internal BGP (iBGP) | 200 |
| Unreachable | 255 |
You’ll be quizzed on the order in interviews and on the CCNA exam. Memorize the connected → static → eBGP → EIGRP → OSPF → RIP → iBGP ladder. See Routing Decision Process for the full process.
Recursive lookup — what happens behind the scenes
When you write:
ip route 10.2.0.0 255.255.255.0 10.0.1.2
The router does:
- Packet arrives destined for
10.2.0.0/24. - Routing table says: “via
10.0.1.2.” - Router needs to know how to reach
10.0.1.2. Look up10.0.1.2in the routing table. - Finds:
10.0.1.0/30 is directly connected, Gi0/1. - ARP for
10.0.1.2onGi0/1. Get the MAC. - Build the Ethernet frame and send.
The lookup for 10.0.1.2 is the recursive lookup. If the routing table can’t find the next-hop, the static route is removed from the route table (still in running-config, but not active).
This is why “next-hop unreachable” is the #1 cause of “my static route isn’t showing up.” Always verify next-hop reachability first.
Summary routes (poor-man’s summarization with statics)
You can advertise a static summary by writing a single static for a large block:
R1(config)# ip route 10.0.0.0 255.255.0.0 Null0
Black-holes anything in 10.0.0.0/16 not matched by a more specific route. Used for:
- BGP origination — advertise a summary you “own” without route flapping when child prefixes flap.
- Loop prevention — prevent traffic from leaving your network for prefixes that shouldn’t exist.
The Null0 is a virtual “drop” interface. Combined with a more specific route to the real next-hop, you get summarization with safety:
R1(config)# ip route 10.0.0.0 255.255.0.0 Null0
R1(config)# ip route 10.0.1.0 255.255.255.0 10.0.99.2
R1(config)# ip route 10.0.2.0 255.255.255.0 10.0.99.2
If a packet arrives for 10.0.5.5 (which doesn’t have a specific route), it hits the /16 to Null0 and drops — no loop, no upstream confusion.
IPv6 static routes
Syntax mirrors IPv4 with ipv6 route and prefix notation:
R1(config)# ipv6 unicast-routing ! enable IPv6 routing globally
R1(config)# ipv6 route 2001:db8:2::/64 2001:db8:1::2 ! next-hop
R1(config)# ipv6 route 2001:db8:2::/64 GigabitEthernet0/0 ! exit interface
R1(config)# ipv6 route ::/0 2001:db8:1::1 ! default route
R1(config)# ipv6 route 2001:db8:3::/64 2001:db8:9::2 200 ! floating static
Verification:
R1# show ipv6 route
R1# show ipv6 route static
All the same principles — next-hop, exit-interface, AD, floating — work identically.
Configuration patterns — production-quality
! With description for traceability
R1(config)# ip route 10.2.0.0 255.255.255.0 10.0.1.2 name BRANCH-2-PRIMARY
! With description + AD for floating backup
R1(config)# ip route 10.2.0.0 255.255.255.0 10.99.99.2 200 name BRANCH-2-BACKUP
! Default route via primary ISP
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1 name DEFAULT-PRIMARY-ISP
! Floating default via backup ISP
R1(config)# ip route 0.0.0.0 0.0.0.0 198.51.100.1 200 name DEFAULT-BACKUP-ISP
! Black-hole an internal summary
R1(config)# ip route 10.0.0.0 255.255.0.0 Null0 name ENTERPRISE-SUMMARY
The name keyword adds a human-readable description visible in show ip route — small touch, big help during outage debugging.
Verification
R1# show ip route
R1# show ip route static
R1# show ip route 10.2.0.0
R1# show ip route 10.2.0.5 ! shows actual route for a specific IP
R1# show ip cef
R1# show ip cef 10.2.0.5
R1# show running-config | include ip route
show ip route 10.2.0.5 is the daily-driver — type any destination IP and the router tells you exactly which route would be used.
show ip cef (Cisco Express Forwarding) shows the FIB (Forwarding Information Base) — the hardware-accelerated forwarding table. Useful when you suspect software-vs-hardware forwarding inconsistencies.
The 5-step static-routing debug
When a static route “isn’t working”:
-
Is the route in the running-config?
show running-config | include ip route. If not, you never saved it or there was a typo. -
Is the route in the routing table?
show ip route static. If in running-config but not in the route table → next-hop unreachable. Verify withping <next-hop>. -
Mask correct?
ip route 10.2.0.0 255.255.255.0matches10.2.0.0/24. If the destination is/23, you wrote the wrong mask. -
Higher-priority route exists for the same prefix?
show ip route <dest>— what AD won? If another protocol learned the same prefix at lower AD, your static is shadowed. -
Recursive lookup OK? If the next-hop is several hops away, can the router get there?
show ip route <next-hop>and walk the chain.
Worked scenarios
Scenario 1. R1 needs to reach 192.168.50.0/24. Next-hop is 10.0.0.2 on R1’s Ethernet. Write the static route.
Answer:
R1(config)# ip route 192.168.50.0 255.255.255.0 10.0.0.2
Scenario 2. R1 has two paths to 10.5.0.0/24: a primary via OSPF (AD 110) and a backup via static. You want the static to only kick in when OSPF fails. AD for the floating static?
Answer: Any AD > 110. Common choice: 200. Anything from 111–254 works. AD 255 means unreachable (the route never installs).
Scenario 3. A static route appears in show running-config but not in show ip route. The next-hop is 10.0.0.2. What’s wrong?
Answer: The router can’t reach 10.0.0.2 via any other route. Either the interface in that subnet is down, the next-hop IP is wrong, or there’s no path to that next-hop at all. Test with ping 10.0.0.2 from the router.
Scenario 4. You configured ip route 10.2.0.0 255.255.255.0 Serial0/0/0 on an Ethernet-attached router (no Serial interfaces at all). What happens?
Answer: The static route never installs because Serial0/0/0 doesn’t exist. Use next-hop IP on Ethernet, or specify the correct interface.
Scenario 5. R1 has a default route ip route 0.0.0.0 0.0.0.0 203.0.113.1. It also has a static for 10.0.0.0/8 via 10.99.99.2. A packet arrives for 10.1.5.5. Which route wins?
Answer: The /8 static. Longest-prefix match wins. 10.1.5.5 matches 10.0.0.0/8 (8 bits matching) and matches 0.0.0.0/0 (0 bits matching). /8 > /0, so the more specific wins regardless of order in the config.
Scenario 6. You want every router in the network to have a default route, but only the edge router has internet uplink. Most reliable approach?
Answer: Two options:
- Manual: Static
ip route 0.0.0.0 0.0.0.0 <next-hop>on every router, pointing at the next hop toward the edge. - Better: OSPF with
default-information originateon the edge router — OSPF propagates the default to all neighbors automatically.
The second scales better and adapts to topology changes; the first requires touching every router on edits.
Scenario 7. A router has these two statics:
ip route 10.0.0.0 255.255.0.0 Null0
ip route 10.0.5.0 255.255.255.0 10.99.0.5
A packet arrives for 10.0.6.10. Where does it go?
Answer: Null0 (the summary). 10.0.6.10 falls in 10.0.0.0/16 but not in 10.0.5.0/24. Longest-prefix match → only the /16 matches → packet hits Null0 and drops. This is the deliberate “loop-prevention summary” pattern.
Scenario 8. You’re configuring a floating static as backup for a primary route via EIGRP (AD 90). You write:
ip route 10.5.0.0 255.255.255.0 10.99.0.5 90
Will this behave as a floating backup?
Answer: No. With AD 90 (same as EIGRP), both routes have equal AD — the router may load-balance or be unpredictable. Use any AD > 90, typically 200, to make it strictly a backup.
Common mistakes
-
Wrong mask. Writing
255.255.255.0when the destination is a /16 means the route never matches. Double-check. -
Pointing to a next-hop that isn’t reachable. Route appears in
show running-configbut never inshow ip route. Test next-hop reachability first. -
Using exit-interface on Ethernet without a next-hop. Causes the router to ARP for every destination IP. Use next-hop on Ethernet, or fully-specified.
-
Forgetting AD on a floating static. Without an AD higher than the primary protocol’s, both routes get equal weight and traffic load-balances unintentionally.
-
Leaving floating static AD = 1. Default AD for static is 1 — beats everything. If you don’t specify a higher AD, your “backup” static overrides OSPF/EIGRP as the primary.
-
Routing loops via reciprocal statics. R1 says “10.2.0.0 via R2”, R2 says “10.2.0.0 via R1.” Packets bounce between them until TTL expires. Always trace routes end-to-end.
-
No
ipv6 unicast-routingfor IPv6 statics. IPv6 routes won’t activate without the global enable, even if you’ve configured everything else. -
Forgetting that
Null0drops packets, not “doesn’t route them.” A summary to Null0 black-holes anything not matched by more specific entries. Intended for some designs; a surprise for others. -
Static default with no upstream connectivity check. Static defaults don’t track health. If the next-hop is alive but the path beyond it is broken, traffic still gets forwarded to a black hole. Combine with IP SLA +
trackto make a static health-aware:R1(config)# ip sla 1 R1(config-ip-sla)# icmp-echo 8.8.8.8 source-interface Gi0/1 R1(config-ip-sla)# frequency 5 R1(config)# ip sla schedule 1 start-time now life forever R1(config)# track 1 ip sla 1 reachability R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 1Now the default route is only installed when IP SLA confirms
8.8.8.8is reachable. -
Hard-coding next-hops that change. ISP-provided IPs may change. Use BGP if your upstream is multi-homed or large-scale; static only when the next-hop is fixed.
Lab to try tonight
-
Three-router line — HQ in the middle, BR1 left, BR2 right. /30 links. LAN behind each branch.
-
Configure statics on HQ — reach BR1 LAN (
10.1.0.0/24) and BR2 LAN (10.2.0.0/24). Test withshow ip routeandping. -
Default routes on the branches — each branch points its default to HQ. Verify with
show ip route 0.0.0.0. -
Branch-to-branch traffic — verify BR1 can reach BR2 via HQ (transit through HQ).
-
Floating backup — bring up a direct BR1↔BR2 link. Add a floating static on each branch with AD 200 pointing directly at the other branch. Verify it doesn’t install while the primary (default through HQ) is healthy.
-
Failure test —
shutdownthe HQ↔BR2 link. Watch the floating static kick in. BR1↔BR2 traffic now goes directly. -
Recovery —
no shutdown. Watch primary re-take over, floating static deactivate. -
Null0 summary — on HQ, add
ip route 10.0.0.0 255.0.0.0 Null0as a black-hole summary. Confirm that any packet for an unassigned10.x.x.xfalls into Null0. -
IP SLA-tracked default — configure an IP SLA pinging an internet target. Tie the default route’s installation to the track object. Block the internet target with an ACL — watch the default route disappear.
-
Bonus: IPv6 static — enable
ipv6 unicast-routingon all three. Add IPv6 statics to mirror the IPv4 ones. Verify withshow ipv6 route.
Cheat strip
| Need | Syntax |
|---|---|
| Static route (next-hop) | ip route 10.2.0.0 255.255.255.0 10.0.1.2 |
| Static route (exit interface) | ip route 10.2.0.0 255.255.255.0 Serial0/0/0 |
| Fully-specified | ip route 10.2.0.0 255.255.255.0 Gi0/0 10.0.1.2 |
| Default route | ip route 0.0.0.0 0.0.0.0 <next-hop> |
| Floating static (backup) | ip route ... <AD> where AD > primary protocol AD |
| Named route | ip route ... name <description> |
| Black-hole summary | ip route 10.0.0.0 255.0.0.0 Null0 |
| IPv6 static | ipv6 route 2001:db8::/64 <next-hop> |
| Common AD values | Connected=0 · Static=1 · eBGP=20 · EIGRP=90 · OSPF=110 · RIP=120 · iBGP=200 |
| Verify | show ip route static or show ip route <dest> |
| Remove | no ip route ... |
| With IP SLA tracking | ip route 0.0.0.0 0.0.0.0 <next-hop> track <object> |
| Recursive lookup | Next-hop must itself be reachable — chains until directly-connected |
Gateway of last resort | Phrase in show ip route that confirms a default exists |
| When to use static | ≤3 routers · stub branches · defaults · floating backups |
| When NOT to use | Anywhere dynamic routing fits — won’t recover from failures |