What's changed: Initial version
3.2Static routing (IPv4/IPv6)
Understands static routing—routes an administrator enters by hand—through its four forms: a network route to a destination network, a host route to a single host, a default route catching all non-matches, and a floating static with a raised AD for backup; and learns to configure and verify ip route / ipv6 route from an operator's viewpoint.
Static routing is still heavily used in practice for small, stable topologies, for single-path (stub) edges, and as a backup to dynamic protocols. CCNA tests not just "memorize the ip route syntax" but the design judgment of which form to choose for the requirement in front of you (the destination's scope, whether redundancy is needed) and what AD to give it. This section makes you able to configure and verify all four forms in both IPv4 and IPv6.
3.2.1The four forms of a static route
- A network route targets an entire subnet. IPv4:
ip route 10.2.2.0 255.255.255.0 192.168.1.2(destination, mask, next hop); IPv6:ipv6 route 2001:db8:2::/64 2001:db8:1::2. You may specify an exit interface instead of a next-hop IP. - A host route targets a single destination, with a mask of /32 for IPv4 and /128 for IPv6. Example:
ip route 10.3.3.3 255.255.255.255 192.168.1.2. It is used to steer one specific server onto a different path (being the most specific, it reliably wins under longest match). - A default route is the exit for every packet that matches no other route. IPv4:
ip route 0.0.0.0 0.0.0.0 203.0.113.1; IPv6:ipv6 route ::/0 2001:db8:1::1. Used for internet-facing or stub sites, it shows up as the gateway of last resort inshow ip route. - A floating static is a static route with a trailing AD value larger than the default of 1 (e.g.,
ip route 10.2.2.0 255.255.255.0 172.16.9.9 200). In normal operation the dynamic route (110 for OSPF) wins, and only when that route disappears does this static "float up" and get installed—serving as a backup route.
Most-tested: a default route's mask is 0.0.0.0 0.0.0.0 (/0) for IPv4 and ::/0 for IPv6; a host route is /32 (IPv4) / /128 (IPv6); and a floating static sets a trailing AD higher than the dynamic protocol to act as backup. "The default AD of a static route is 1" is also common. Note too that you can write either a next hop or an interface.
Suppose you design the head-office-to-branch connection, and the branch has two links: a primary (leased line, learned via OSPF) and a backup (a cheap internet VPN). The requirement is "use the primary normally, and switch to the backup automatically only when the primary fails." If you naively enter just ip route 10.0.0.0 255.0.0.0 <VPN next hop>, the static AD of 1 is smaller than OSPF's 110, so the static (backup) route is always preferred even while the primary is up—the exact opposite of the intent. The correct approach is to append an AD value, ip route 10.0.0.0 255.0.0.0 <VPN next hop> 200, making it a floating static. Now AD 200 exceeds OSPF's 110, so in normal operation it is not installed and the primary OSPF route is used. Only when the primary fails and the OSPF route leaves the table does the AD-200 static "float up," get installed, and shift traffic to the backup. IPv6 uses the same idea: ipv6 route 2001:db8::/32 <VPN next hop> 200. "Backup = just add a static route" is wrong; it functions as a backup only once its AD is set higher than the primary's—this design judgment is the essence of the floating static. To verify the failover, watch show ip route and confirm the static route appears the instant the primary route disappears.
| Form | IPv4 example | IPv6 example | Purpose |
|---|---|---|---|
| Network route | `ip route 10.2.2.0 255.255.255.0 192.168.1.2` | `ipv6 route 2001:db8:2::/64 2001:db8:1::2` | Route to an entire subnet |
| Host route | `ip route 10.3.3.3 255.255.255.255 192.168.1.2` | `ipv6 route 2001:db8:2::9/128 2001:db8:1::2` | A single host (/32, /128) |
| Default route | `ip route 0.0.0.0 0.0.0.0 203.0.113.1` | `ipv6 route ::/0 2001:db8:1::1` | Exit for all non-matches |
| Floating static | `ip route 10.2.2.0 255.255.255.0 172.16.9.9 200` | `ipv6 route 2001:db8:2::/64 2001:db8:1::9 200` | Backup with AD > dynamic |
Trap: "Just adding a static route for the backup link gives you failover" is wrong—a static route entered without an AD value has AD=1 and always beats the dynamic route (OSPF=110, etc.), so traffic flows over the backup all the time and the primary is never used. To make it a backup you need a floating static with a trailing AD higher than the primary. Also wrong: "a default route can only be created by OSPF or similar"—ip route 0.0.0.0 0.0.0.0 <next hop> creates one statically.
3.2.2Section summary
- Static routes come in four forms—network / host (/32, /128) / default (0.0.0.0 0.0.0.0, ::/0) / floating static—with a default AD of 1
- IPv4 uses
ip route, IPv6 usesipv6 route; you can specify a next-hop IP or an exit interface - A floating static sets its trailing AD higher than the dynamic protocol so it floats up as a backup only when the primary route fails
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. A branch has a primary link (routes learned via OSPF, AD=110) and a backup link, with the requirement "use the primary normally, and switch to the backup automatically only on primary failure." How should the static route for the backup link be configured?
Q2. At an IPv6 stub site, you want a static default route sending all destinations except known internal prefixes to the ISP router `2001:db8:1::1`. Which command is most appropriate?
Q3. An operator wants to steer traffic to a single server `10.5.5.7`—and only that server—through a separate monitoring router, while leaving other `10.5.5.0/24` traffic on its existing route. Which static route is most appropriate?

