3.3 IPv4 and IPv6 Static Routing
Key Takeaways
- Static routes are manually configured and have an AD of 1 by default.
- A default static route (0.0.0.0/0) is the gateway of last resort and matches all destinations.
- A floating static route uses a higher AD to serve as a backup when a dynamic route is preferred.
- A host route (/32 for IPv4, /128 for IPv6) matches a single specific IP address.
- An IPv6 static route using a link-local next hop must also specify the exit interface.
Static routes are manually configured entries telling the router exactly where to send traffic for specific destinations. They do not adapt — if a link fails or topology changes, an administrator must update them by hand. Their default administrative distance of 1 makes them extremely trusted: a static route beats any dynamic route (OSPF 110, EIGRP 90, RIP 120) to the same prefix.
When to Use Static Routes
| Scenario | Why Static? |
|---|---|
| Small / stub networks | Simple, no protocol CPU or bandwidth overhead |
| Default route to ISP | One exit point — dynamic routing is overkill |
| Backup paths | Floating static routes provide failover |
| Specific host routes | Pin a path to a single critical server |
| Predictable, deterministic paths | Routes never change unexpectedly |
IPv4 Static Route Configuration
Basic Syntax
Router(config)# ip route <destination-network> <subnet-mask> {next-hop-ip | exit-interface} [AD]
Static Route Types
Network route — to a specific subnet:
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2
Meaning: "To reach 192.168.20.0/24, send packets to next-hop 10.0.0.2."
Default route — matches everything not matched more specifically:
Router(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.1
The /0 prefix sets 10.0.0.1 as the gateway of last resort.
Host route — a single /32 address:
Router(config)# ip route 192.168.20.100 255.255.255.255 10.0.0.2
Floating static route — a backup with a deliberately higher AD:
Router(config)# ip route 192.168.20.0 255.255.255.0 10.0.1.2 200
The trailing 200 sets AD to 200. While OSPF (AD 110) has the route, OSPF wins; if OSPF withdraws it, the floating static (AD 200) installs and takes over.
Next-Hop Options and Recursive Lookup
| Option | Example | Behavior |
|---|---|---|
| Next-hop IP | ip route 10.1.0.0 255.255.0.0 10.0.0.2 | Recursive — router must resolve how to reach 10.0.0.2 |
| Exit interface | ip route 10.1.0.0 255.255.0.0 Gi0/0 | Directly attached — ARPs for the destination on Gi0/0 |
| Fully specified | ip route 10.1.0.0 255.255.0.0 Gi0/0 10.0.0.2 | Both — best practice on Ethernet links |
A recursive lookup means the router does a second table lookup to find the exit interface for the next-hop IP. If that recursion fails (no route to the next hop), the static route is not installed at all.
On the Exam: On point-to-point serial links, an exit-interface-only static is fine. On multi-access Ethernet, always supply a next-hop IP (or fully specify both) so the router knows which neighbor to ARP for instead of ARPing for every remote host.
IPv6 Static Route Configuration
Basic Syntax
Router(config)# ipv6 unicast-routing
Router(config)# ipv6 route <prefix/length> {next-hop | exit-interface} [AD]
Note that ipv6 unicast-routing must be enabled globally or the router will not forward IPv6 at all — a classic missed step.
! Network route
Router(config)# ipv6 route 2001:DB8:2::/64 2001:DB8:1::2
! Default route
Router(config)# ipv6 route ::/0 2001:DB8:1::1
! Link-local next hop REQUIRES an exit interface
Router(config)# ipv6 route 2001:DB8:2::/64 GigabitEthernet0/0 FE80::2
! Floating static route (AD 200)
Router(config)# ipv6 route 2001:DB8:2::/64 2001:DB8:1::2 200
Important: A link-local address (FE80::/10) is unique only on its own link, so the same FE80:: value can appear on many interfaces. When you use a link-local next hop you must also name the exit interface so the router knows which link to use.
Verification Commands
Router# show ip route ! Full IPv4 table
Router# show ip route static ! Only static IPv4 routes
Router# show ip route 192.168.20.0 ! Detail for one prefix
Router# show ipv6 route
Router# show ipv6 route static
Static Route Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Route missing from table | Next hop unreachable / recursion fails | Verify next-hop reachability with ping |
| Route present but traffic fails | Remote router lacks a return route | Configure the reverse route on the far end |
| Floating static won't activate | Primary dynamic route still present | Confirm the primary route was withdrawn |
| Wrong forwarding | Incorrect mask or next-hop | Recheck with show ip route and correct it |
| IPv6 not forwarding at all | ipv6 unicast-routing not enabled | Enable it globally |
Worked Example: Building a Floating Backup
Imagine a branch router with a primary fiber link to headquarters running OSPF, plus a cheaper cellular backup. You want the cellular path used only when fiber fails. Configure the backup as a floating static: ip route 10.0.0.0 255.255.255.0 192.0.2.1 130. Because OSPF's AD is 110 and your floating static is 130, OSPF wins while the fiber is healthy and the static stays out of the table. When OSPF withdraws the route on a fiber failure, the AD-130 static becomes the best remaining option and installs automatically — failover with no operator action. Pick a backup AD higher than the protocol it backs up but lower than 255.
Recursive Lookup in Action
A next-hop-IP static route forces a recursive lookup: the router must already know how to reach the next hop. If you enter ip route 172.16.0.0 255.255.0.0 10.0.0.2 but the router has no route to 10.0.0.2, the static route is computed as invalid and silently omitted from show ip route. Candidates often add a static route and panic when it does not appear — the cause is usually an unreachable next hop. Either ensure a route to the next hop exists, or use a fully specified entry naming both the exit interface and the next-hop IP to remove the recursion on Ethernet links.
Static Routing on Point-to-Point vs. Ethernet
The medium changes best practice. On a point-to-point serial link there is exactly one device at the far end, so an exit-interface-only static (ip route ... Serial0/0) is unambiguous and efficient. On multi-access Ethernet, an exit-interface-only static makes the router treat every remote destination as directly connected and ARP for each one, flooding the segment with ARP requests and bloating the ARP cache. Always supply a next-hop IP — or fully specify both — on Ethernet so the router ARPs once for the single next-hop neighbor.
What command configures a default static route on a Cisco router?
What is a floating static route?
When configuring an IPv6 static route with a link-local next-hop address, what additional parameter is required?