Static & Default Routing Cheat Sheet
Exact Cisco IOS syntax for static, default, floating-static, and IPv6 static routes, plus how to read the routing table and confirm reachability. Built for CCNA/CCNP learners to bookmark or print alongside the graded labs.
Part of the Static & Default Routing learning hub
Static Routes
Default administrative distance of a static route is 1. Configure in global config mode.
| Command | What it does |
|---|---|
ip route <network> <mask> <next-hop-ip> | Recursive static route: router must resolve <next-hop-ip> in the table before installing. |
ip route <network> <mask> <exit-interface> | Directly-attached route out a local interface; relies on proxy-ARP at the far end for the next hop. |
ip route <network> <mask> <exit-interface> <next-hop-ip> | Fully specified route (both exit interface and next hop) — avoids recursion and proxy-ARP; preferred on multi-access links. |
ip route <network> <mask> <next-hop-ip> <AD> | Sets a non-default administrative distance (1-255) to control preference between routes. |
no ip route <network> <mask> <next-hop-ip> | Removes the static route. |
show running-config | include ip route | Displays all configured static routes. |
Default Route
0.0.0.0/0 matches any destination; installs the 'gateway of last resort'.
| Command | What it does |
|---|---|
ip route 0.0.0.0 0.0.0.0 <next-hop-ip> | Recursive default route toward <next-hop-ip>. |
ip route 0.0.0.0 0.0.0.0 <exit-interface> | Default route out a local interface (proxy-ARP dependent). |
ip route 0.0.0.0 0.0.0.0 <exit-interface> <next-hop-ip> | Fully specified default route. |
show ip route | begin Gateway | Confirms 'Gateway of last resort is <next-hop> to network 0.0.0.0'. |
Floating Static / Backup Route
A higher AD than the primary path keeps the backup out of the table until the primary drops.
| Command | What it does |
|---|---|
ip route <network> <mask> <primary-next-hop> | Primary path, default AD 1 — installed normally. |
ip route <network> <mask> <backup-next-hop> 200 | Floating static backup: AD 200 exceeds the primary (and most IGPs), so it installs only when the primary is withdrawn. |
ip route 0.0.0.0 0.0.0.0 <backup-next-hop> 250 | Floating default route (e.g. backup WAN) that activates when the primary default fails. |
IPv6 Static Routes
IPv6 routing is OFF by default — enable it globally first. With a link-local next hop you must also give the exit interface.
| Command | What it does |
|---|---|
ipv6 unicast-routing | Global command that enables IPv6 packet forwarding/routing (required before any IPv6 route is used). |
ipv6 route <prefix>/<len> <next-hop-ipv6> | Recursive IPv6 static route to a global next-hop address. |
ipv6 route <prefix>/<len> <exit-interface> <link-local-next-hop> | Fully specified route required when the next hop is a link-local (FE80::) address. |
ipv6 route ::/0 <next-hop-ipv6> | IPv6 default route (gateway of last resort). |
ipv6 route <prefix>/<len> <next-hop-ipv6> <AD> | IPv6 floating static — raise the AD above the primary for backup. |
Verification & Routing-Table Codes
Use these to confirm a route installed and that the path actually forwards traffic.
| Command | What it does |
|---|---|
show ip route | Full IPv4 routing table with source codes and the gateway of last resort. |
show ip route static | Filters to only statically configured routes. |
show ip route <network> | Detailed entry for one prefix: mask, next hop, metric, AD, and exit interface. |
show ipv6 route [static] | IPv6 routing table (add 'static' to filter). |
ping <dest-ip> | Tests end-to-end reachability to the destination. |
traceroute <dest-ip> | Shows the hop-by-hop path; reveals where forwarding breaks. |
Route-Code Legend
First-column codes in 'show ip route' output.
| Code | Meaning | Default AD |
|---|---|---|
C | Connected (interface up/up with an IP) | 0 |
L | Local (the interface's own /32 or /128 host route) | 0 |
S | Static route | 1 |
S* | Static default route (candidate default / gateway of last resort) | 1 |
O | OSPF | 110 |
D | EIGRP | 90 |
Frequently asked questions
What's the difference between a next-hop and an exit-interface static route?
A next-hop route (ip route <net> <mask> <next-hop-ip>) is recursive: the router must first look up how to reach the next-hop IP before it can install and use the route. An exit-interface route (ip route <net> <mask> <interface>) treats the destination as directly attached out that interface and relies on proxy-ARP at the far end to resolve each destination — which is fragile on multi-access (Ethernet) links. Best practice is a fully specified route that lists both: ip route <net> <mask> <interface> <next-hop-ip>.
How do I create a backup route that only kicks in when the primary path fails?
Configure a floating static route: give the backup a higher administrative distance than the primary. For example, ip route 10.0.0.0 255.0.0.0 192.0.2.1 (default AD 1) as primary and ip route 10.0.0.0 255.0.0.0 198.51.100.1 200 as backup. Because AD 200 is worse, the backup stays out of the routing table until the primary next hop becomes unreachable, at which point it is installed automatically.
My static route is configured but doesn't appear in 'show ip route' — why?
For a recursive (next-hop) route, IOS won't install it unless the next-hop IP is itself reachable via another table entry; if that resolving route disappears, the static route drops out too. Also confirm the exit interface is up/up, and check that a lower-AD route (a connected route or an IGP-learned route) isn't already winning for that prefix. Use show ip route <network> to see exactly what installed.
Stop memorizing — practice on real Cisco IOS
A cheat sheet gets you unstuck; a graded lab makes it stick. Start with the free sample.