Skip to main content
Open menu
Home
Training
Learn
CCNA Library (74)
Browse all CCNA topics →
Network (13)
Device Operations (5)
Network Access (12)
Wireless (6)
IP Connectivity (10)
IP Services (11)
Security (10)
Automation (7)
CCNP Library (15)
Practice
Mock ExamPricing
Contact 📞 +1 (860) 556-3010 Book a Call
← All posts
ccnastatic-routingrouting

Static routing done right — floating static, admin distance, and default routes

Everything you need to configure static routes with confidence: next-hop vs exit-interface, admin distance, floating statics as backup, the default route ('quad zero'), and why the wrong syntax silently drops your recursive lookup.

Static routing looks like the simplest thing on the CCNA — one line, done. It’s actually the topic where you find out whether you truly understand how a router decides where to send a packet. Because static routes force you to think about it explicitly. Nothing is auto-negotiated. Every choice you make is visible.

Here’s the working knowledge to configure static routes without shooting yourself in the foot.

The mental model — where does the router send it?

When a packet arrives at a router, it does two things:

  1. Look up the destination IP in the routing table using longest-prefix match.
  2. Forward the packet according to the matched route’s next-hop or exit interface.

That’s the whole story. Everything in routing — static, dynamic, dynamic-with-redistribution, PBR — is just a different way to populate that table.

Static routing means the admin writes each entry by hand. The router doesn’t learn from a neighbor, doesn’t run an algorithm, doesn’t recompute after a failure. It just uses what you told it, forever, until you change it or remove the interface it depends on.

The syntax — two flavors

Router(config)# ip route <destination-network> <mask> <next-hop-ip>
Router(config)# ip route <destination-network> <mask> <exit-interface>

Two flavors:

  • Next-hop-IP: “to reach 192.168.20.0/24, send it to the router at 10.0.0.2.”
  • Exit-interface: “to reach 192.168.20.0/24, send it out my g0/1 interface.”

Both work in most cases, but they behave differently under the hood.

Next-hop IP

Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2

When a packet destined for 192.168.20.x arrives, the router:

  1. Looks up 192.168.20.0/24 → finds the static route with next-hop 10.0.0.2.
  2. Now needs to know how to reach 10.0.0.2 — does a recursive lookup in the routing table.
  3. Finds 10.0.0.0/24 is directly connected on g0/1.
  4. ARPs for 10.0.0.2, gets MAC, sends the frame.

This is called recursive routing. Advantage: it works no matter which of your interfaces 10.0.0.2 sits behind. Disadvantage: if the interface goes down but there’s still a route to it via another path, forwarding continues; the static won’t get removed from the table just because one interface flapped.

Exit-interface

Router(config)# ip route 192.168.20.0 255.255.255.0 g0/1

When a packet destined for 192.168.20.x arrives:

  1. Looks up 192.168.20.0/24 → finds static route pointing to g0/1.
  2. Sends the packet out g0/1 — no recursion needed.
  3. On a broadcast segment (Ethernet), the router must ARP for the destination directly. If the destination is a remote host, this doesn’t work naturally — the destination isn’t on this segment.

Exit-interface syntax works on point-to-point links (WAN serial, GRE tunnels) but not on Ethernet unless you also specify the next-hop. Cisco IOS actually warns you on Ethernet.

The best-of-both syntax

Router(config)# ip route 192.168.20.0 255.255.255.0 g0/1 10.0.0.2

Both exit-interface and next-hop-IP. This is what production configs usually use. The interface tells the router where to forward without recursion. The IP tells it who to ARP for. Fast lookup, correct on Ethernet.

Administrative distance — who wins

Every route source has a default administrative distance (AD) — a “trust rating” from 0 to 255. Lower AD wins.

SourceAD
Directly connected0
Static1
eBGP20
EIGRP internal90
OSPF110
RIP120
iBGP200
Unknown / unreachable255

A route with AD 255 will not be installed in the routing table.

Static routes have AD 1 by default. That means a static route will beat almost any dynamic route to the same destination. Sometimes that’s what you want (override OSPF for one prefix). Sometimes it’s not (backup route only kicks in when the dynamic one fails).

Floating static — the backup route

You want a static route as a backup. If OSPF has learned a route, use OSPF (path is auto-adjusted, converges quickly). If OSPF’s route disappears, fall back to the static.

Give the static a higher AD than the dynamic protocol:

Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.99.2 200

The trailing 200 sets the AD to 200. OSPF (110) beats it. But if OSPF loses its route to 192.168.20.0, the static becomes the winner and gets installed. When OSPF re-learns, the static “floats” out again.

This is the floating static — one of the most useful patterns in real networks. Every ISP-connected router I’ve seen has a floating static to the backup ISP with AD ~180.

The default route — “quad-zero”

Router(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.1

This is a “match everything” route. It says: for any destination not matched by a more-specific route, send it to 10.0.0.1. This is the default route or “quad-zero” (from the four zeros in the network and mask).

Used everywhere:

  • The router at the edge of your LAN pointing at your ISP.
  • A branch router pointing at the head-office router.
  • A default injected into OSPF or EIGRP to give all interior routers a way out.

You can also use exit-interface with a default route:

Router(config)# ip route 0.0.0.0 0.0.0.0 g0/0

Same warnings apply — on Ethernet, use the next-hop version, or combine.

Longest-prefix match — the tiebreaker

If the routing table has both:

  • 10.0.10.0/24 via OSPF, AD 110
  • 10.0.0.0/8 static, AD 1

…and a packet arrives for 10.0.10.5, which route wins?

Longest prefix match wins first. /24 is longer than /8. AD isn’t consulted because the two routes aren’t for the same destination. /24 wins. OSPF’s route is used.

AD only breaks ties when two routes have the same destination network and prefix length.

Show commands

Router# show ip route
Router# show ip route static
Router# show ip route 192.168.20.5

show ip route gives you the whole table. show ip route static filters to statics only. show ip route <ip> performs a specific lookup and shows which route matched — perfect for verifying floating-static behavior.

Read show ip route output like this:

S    192.168.20.0/24 [1/0] via 10.0.0.2
  • S = static route.
  • [1/0] = AD 1, metric 0.
  • via 10.0.0.2 = next-hop.

If you set the AD to 200 (floating static):

S    192.168.20.0/24 [200/0] via 10.0.99.2

Common mistakes

  1. Exit-interface on Ethernet. Gives you an ARP for a destination that isn’t on this segment. Use next-hop IP for Ethernet.

  2. Missing the no in a mistake. Wrote ip route 192.168.20.0 255.255.255.0 10.0.0.99 when you meant 10.0.0.2. Now traffic disappears. Remove the wrong entry with no ip route ... 10.0.0.99 and re-enter. Very easy to end up with two conflicting statics loading round-robin.

  3. Floating static without a higher AD. Default AD is 1. Same as another static, or even better than a dynamic route. It becomes the primary instead of the backup.

  4. Default route pointing to the wrong interface. If your default is ip route 0.0.0.0 0.0.0.0 g0/1 and g0/1 is a LAN, all internet traffic tries to ARP for every destination on your LAN. Nothing works.

  5. Forgetting to save. write memory. Or on reboot the static disappears and someone gets paged.

  6. Recursive lookup loop. ip route 10.0.0.0 255.0.0.0 10.0.0.2 — the router needs to know where 10.0.0.2 is to reach 10.0.0.0/8, but the only route to 10.0.0.0/8 is via 10.0.0.2. The recursion never resolves. Route is invalid; IOS usually catches this.

When to use static vs dynamic

Static wins when:

  • Small network (2-3 routers) with clear topology.
  • Backup path (floating static).
  • Stub network with only one exit (branch office → head office).
  • Default route to the ISP.

Dynamic wins when:

  • More than a handful of routes to maintain.
  • Redundant paths that need automatic failover.
  • Multiple exit points.

Real networks usually mix: dynamic for the interior, static for the edges. Static routing is where every network engineering career begins.

Cheat strip

ConceptOne-line meaning
ip route dest mask next-hopRecursive lookup, safe on any medium
ip route dest mask interfaceDirect-forward, safe on point-to-point only
ip route dest mask int next-hopCombined — best-of-both, use on Ethernet
AD 1Default AD of static route
Floating staticip route ... AD where AD > dynamic protocol’s AD
Default routeip route 0.0.0.0 0.0.0.0 next-hop — match everything
Longest prefix matchMost-specific /prefix wins before AD is even checked
show ip route staticFilter routing table to statics only
show ip route <ip>Show exactly which route matched an IP

The exam lens

CCNA questions on static routing usually test one of three things:

  1. Syntax recognition — spot the correct ip route command for a given topology.
  2. AD reasoning — given two routes to the same destination with different ADs, which is installed?
  3. Floating static setup — configure a backup static route that’s used only when the primary fails.

Practice all three. Configure a small three-router topology in Packet Tracer, set up static + floating static + default. Watch what happens when you shut interfaces. That drill takes 15 minutes and locks the concepts in permanently.

Once you’re comfortable with static, dynamic routing (OSPF, EIGRP) is just a smarter way of populating the same table you now understand cold.

Get posts like this by email.

One short, opinionated tutorial per week. Unsubscribe in one click.

Personal reply from a senior network engineer. No third-party tracking. Unsubscribe any time.