Cisco IOS
Static Route Generator
Build Cisco IPv4/IPv6 static, default, floating, and Null0 routes with show commands and troubleshooting
What is a Static Route?
A static route is a manually configured route that tells the router exactly how to reach a destination network via a specified next-hop IP or exit interface. Unlike dynamic routing protocols (OSPF, EIGRP, BGP), static routes do not adapt automatically when the network changes.
- Predictable — traffic always follows the path you define.
- Lightweight — zero routing protocol overhead.
- Secure — no routing updates to spoof or hijack.
- Manual — must be updated by hand when topology changes.
Static Route Types
| Type | Command Format | Use Case |
|---|---|---|
| Standard | ip route <net> <mask> <next-hop or intf> | Route to a specific network via next-hop IP or exit interface |
| Default Route | ip route 0.0.0.0 0.0.0.0 <next-hop> | Gateway of last resort — matches all traffic not matched by a more specific route |
| Floating Static | ip route <net> <mask> <next-hop> <AD> | Backup route with higher Administrative Distance; only used if primary route fails |
| Summary Static | ip route <supernet> <mask> <next-hop> | One route covering a block of contiguous networks to reduce routing table size |
| Null0 (Black Hole) | ip route <net> <mask> Null0 | Discard traffic matching the route; prevents routing loops and blocks unwanted traffic |
| IPv6 Static | ipv6 route <prefix/len> <next-hop> | Same as IPv4 but for IPv6 address space |
Administrative Distance (AD)
AD is a trustworthiness score for route sources. Lower AD wins. A floating static route uses a higher AD than the primary dynamic protocol so it only becomes active when the preferred route disappears.
| Route Source | Default AD |
|---|---|
| Connected | 0 |
| Static Route | 1 |
| eBGP | 20 |
| EIGRP (internal) | 90 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| EIGRP (external) | 170 |
| iBGP | 200 |
| Unreachable / Floating | 255 |
Next-Hop vs. Exit Interface
| Method | Example | Notes |
|---|---|---|
| Next-hop IP | ip route 10.0.0.0 255.0.0.0 192.168.1.1 | Most common. Router performs recursive lookup to find exit interface. |
| Exit Interface only | ip route 10.0.0.0 255.0.0.0 GigabitEthernet0/1 | Avoid on multi-access (Ethernet) — causes ARP for every destination. OK on P2P serial. |
| Both (Recommended) | ip route 10.0.0.0 255.0.0.0 Gi0/1 192.168.1.1 | No recursion + ARP for only the next-hop IP. Best practice for Ethernet. |
Best Practice: On multi-access (Ethernet) interfaces, always specify both the exit interface and next-hop IP to avoid proxy-ARP issues and recursive lookup overhead.
Caution: Static routes require manual updates when network topology changes. Use
dynamic routing protocols for larger environments and static routes only at the edge or for specific
policy needs.
Route Entry Builder
conf t
ip route 10.10.10.0 255.255.255.0 192.168.1.1
!
end
copy running-config startup-config Static Route Show & Verification Commands
| Command | Purpose |
|---|---|
| show ip route | Full IPv4 routing table — S = static, S* = default static |
| show ip route static | Show only static routes in the routing table |
| show ip route 10.10.10.0 | Lookup a specific network — shows best path, AD, and metric |
| show ip route 0.0.0.0 | Verify default route (gateway of last resort) is installed |
| show running-config | include ip route | View all configured static routes from running config |
| show running-config | section ip route | Full static route section of running config |
| show ip route summary | Route count by type: connected, static, OSPF, etc. |
| show ip cef <dest> | CEF forwarding lookup — shows actual forwarding path in hardware |
| show ip cef exact-route <src> <dst> | CEF path for a specific source/destination pair |
| show ip interface brief | Verify exit interfaces are up/up before adding static routes |
| ping <destination> source <intf> | Test reachability to a static route destination from a specific source |
| traceroute <destination> | Trace hop-by-hop path to verify routing |
| show ipv6 route | Full IPv6 routing table |
| show ipv6 route static | Show only IPv6 static routes |
| show running-config | include ipv6 route | All configured IPv6 static routes |
| debug ip routing | Live debug when routes are added/removed from RIB (use with caution in production) |
Reading the Route Table:
S = Static | S* = Static default route | [1/0] = [AD/metric] | via = next-hop IP or interface.
Route Table Code Legend
| Code | Meaning |
|---|---|
| S | Static route |
| S* | Static default route / gateway of last resort |
| C | Connected (directly attached) |
| L | Local (router's own interface IP, /32) |
| O | OSPF |
| D | EIGRP |
| B | BGP |
| R | RIP |
| i | IS-IS |
Static Route Not Working — Checklist
-
Route not in the table? Run
show ip route static. If missing, the exit interface may be down or the next-hop is unreachable. -
Check exit interface state —
show ip interface brief. A route pointing to a down interface is not installed in the RIB (unless next-hop IP is also specified). -
Verify next-hop reachability —
ping <next-hop-IP>. The next-hop must be directly reachable via a connected subnet. -
More-specific route overriding? —
show ip route <dest>. A /28 always beats a /24 regardless of AD. - Confirm correct subnet mask — a /24 entered as /25 will silently miss half the range.
-
Floating static not appearing? — The primary route is still
active. Remove it temporarily to test:
no ip route <net> <mask> <primary-nexthop>. -
Null0 route causing unexpected drops? — Verify with
show ip route null0that it is not matching traffic it should not. - Recursive lookup failure — If the next-hop IP is not reachable via a connected route, the static route will not be installed.
-
IPv6 routes not working? — Confirm
ipv6 unicast-routingis enabled globally, then checkshow ipv6 route. -
Use CEF for forwarding verification —
show ip cef <dest>confirms what the forwarding plane actually uses.
Common Mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| Wrong subnet mask | Route installed but some hosts unreachable | Recalculate mask; use show ip route <host-ip> to check the matching
route |
| Next-hop not reachable | Route absent from routing table | Ensure next-hop is on a directly connected subnet; ping it first |
| Exit interface only on Ethernet | Massive ARP table, intermittent drops | Specify both exit interface and next-hop IP |
| Floating AD too low | Floating route wins over dynamic protocol | Set AD higher than primary (e.g., 210 for OSPF backup) |
| Missing reverse route | One-way reachability; ping works one direction only | Add a static route on the remote router pointing back |
| Typo in destination | Traffic goes to wrong network or drops | show run | include ip route and review carefully |
| Forgetting to save | Routes disappear after reboot | copy running-config startup-config |
Routing Loop Risk: Never configure a static route where the next-hop is reachable
only via that same static route — this creates a recursive lookup loop and black-holes
traffic.