Static and Dynamic Routing
A router only forwards to networks it knows. There are exactly two ways to teach it: enter the routes by hand (static) or let protocols exchange routes automatically (dynamic). Knowing when to choose each — and the default administrative distances — is guaranteed exam material.
Three ways a route gets into the table
Every route in a routing table is either directly connected (added automatically when an interface comes up), static (typed in by an administrator), or dynamic (learned from a routing protocol that talks to other routers). The first kind is not a choice. The real design decision is static versus dynamic, and it is fundamentally a trade-off between control and automation.
Connected
Created by IOS when an interface is up and addressed. Administrative distance 0. Always wins for its own subnet.
Static
Written by an administrator, one route at a time. Administrative distance 1. Never changes unless you change it.
Dynamic
Learned by exchanging updates with neighbours. Reconverges on its own after a failure.
Static routes: what and when
A static route is a manually configured statement that says “to reach this network, send packets to this next hop”. The router never negotiates it and never changes it; if the topology changes, you change it by hand.
Small, flat, stable networks, where dynamic updates add little value.
There is a stub link or stub network — a link with only one exit, so there is only one way out and nothing to converge.
There is no bandwidth or CPU to spare for protocol updates (a low-speed WAN link, a tiny branch router).
You need a very specific or controlled path, such as a fixed backup route.
A static route is a route entered manually by an administrator. It is fixed, does not adapt to topology changes, and has a default administrative distance of 1 — better (lower) than any dynamic protocol, so it wins against a dynamic route to the same prefix. The trade-off is that it does not adapt: a dead next hop is not replaced unless you also configure a floating static route.
Configuring a static route
The syntax is ip route <destination> <mask> <next-hop or interface>. Use the remote network as the destination and the neighbouring router’s address as the next hop.
The route appears with the code S, an administrative distance of 1, and a metric of 0 (static routes carry no protocol metric). You can point the route at an exit interface instead of a next-hop address on point-to-point links, but on Ethernet a next-hop address is preferred because it avoids extra overhead and ambiguity.
The default static route
The default static route is a special static route for 0.0.0.0/0 — the gateway of last resort from Lesson 11. It says “anywhere I do not specifically know, send here”, and it is how an edge router points to its ISP.
Router(config)# ip route 0.0.0.0 0.0.0.0 192.168.10.2
Because 0.0.0.0/0 has a prefix length of zero, it matches everything and is chosen only when no more specific route exists — the longest-prefix rule guarantees it. It is by far the most common static route you will write in a lab.
ip route 0.0.0.0 0.0.0.0 <next-hop> is the IPv4 default route. Both the destination and the mask are 0.0.0.0. A route written that way is also called the quad-zero route.Floating static routes
A floating static route is a static route given a higher administrative distance than the primary route it backs up. Because lower AD wins, a floating static stays out of the active path while the primary route exists, and “floats” into the table to take over only when the primary is lost. The example below backs up an OSPF route (AD 110) with a static route set to AD 200, so it is inactive while OSPF is up.
! primary route is OSPF (AD 110) to the same network Router(config)# ip route 192.168.20.0 255.255.255.0 192.168.40.2 200 ! the trailing 200 is the administrative distance of this static route
Any AD greater than the primary route’s works; 200 is a common choice because it is higher than every common interior protocol. If the OSPF route disappears, the static route (AD 200, still lower than “unreachable”) becomes the best match and traffic reroutes.
Dynamic routing protocols
A dynamic routing protocol lets routers advertise the networks they know to their neighbours, so the whole network learns reachability automatically and reconverges when links fail. The three you must know for CCNA are RIP, OSPF, and EIGRP.
| Protocol | Type | Metric | Default AD | Key points |
|---|---|---|---|---|
| RIP | Distance-vector | Hop count | 120 | Simplest; maximum 15 hops (16 = unreachable); periodic updates. |
| OSPF | Link-state | Cost (bandwidth-based) | 110 | Runs Dijkstra’s SPF; hierarchical, area-based (area 0 is the backbone). |
| EIGRP | Hybrid (advanced distance-vector) | Composite (bandwidth + delay) | 90 | Cisco-origin; fast convergence; internal AD 90. |
Administrative distance
Administrative distance (AD) is a trust rating from 0 to 255. When two sources offer a route to the same prefix, the router installs the one with the lower distance. These are the canonical values you must memorise.
| Route source | Default administrative distance | Code |
|---|---|---|
| Connected interface | 0 | C |
| Local (interface host route) | 0 | L |
| Static route | 1 | S |
| EIGRP (internal) | 90 | D |
| OSPF | 110 | O |
| RIP | 120 | R |
Static vs dynamic
The trade-off, side by side. Pick an aspect to see the trade-off in one line.
| Aspect | Static routing | Dynamic routing |
|---|---|---|
| Configuration | Manual, per route | Configure the protocol; routes learned automatically |
| Adapts to failures | No (unless a floating static is used) | Yes — reconverges on its own |
| Scalability | Poor in large networks | Good — designed for large networks |
| Overhead | None (no updates sent) | Uses CPU, memory, and bandwidth for updates |
| Control / predictability | Complete | Less direct; depends on the protocol |
| Security exposure | No routing updates to spoof | Protocol traffic must be protected/authenticated |
| Best for | Small/stable networks, stub links, default routes, backups | Large or changing networks |
Where each appears in show ip route
Every source has its own code in the output (Lesson 11 covered the lookup itself). A static route is S, EIGRP is D, OSPF is O, and RIP is R. Directly connected networks show as C (with an L local host route for the interface address). The bracketed value shows the distance that decided the entry.
Router# show ip route S 192.168.20.0/24 [1/0] via 192.168.10.2 O 192.168.30.0/24 [110/2] via 192.168.10.2, 00:05:31, GigabitEthernet0/1 D 192.168.40.0/24 [90/3072] via 192.168.10.2, 00:12:04, GigabitEthernet0/1 R 192.168.50.0/24 [120/1] via 192.168.10.2, 00:00:18, GigabitEthernet0/1
Key terms
- Static route — a manually configured route; AD 1; does not adapt to changes.
- Default static route —
ip route 0.0.0.0 0.0.0.0 <next-hop>; the quad-zero gateway of last resort. - Floating static route — a static route with a higher AD, used as an automatic backup.
- Dynamic routing — learning routes automatically from a routing protocol.
- RIP — distance-vector protocol using hop count; max 15 hops; AD 120.
- OSPF — link-state protocol using Dijkstra’s SPF and areas; AD 110.
- EIGRP — hybrid/advanced distance-vector protocol with a composite metric; internal AD 90.
- Administrative distance — a 0–255 trust rating of a route source; lower is preferred.
- Convergence — the point at which all routers agree on the topology after a change.
- Stub network — a network reachable by only one path, often served by a static route.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. IP Routing: Protocol-Independent Configuration Guide — static routes, floating static routes, and administrative distance. cisco.com.
- Cisco. IP Routing: RIP Configuration Guide, OSPF Configuration Guide, and EIGRP Configuration Guide. cisco.com.
- Cisco. CCNA (200-301) Exam Topics, IP Connectivity (static and dynamic routing, administrative distance). cisco.com.
- Hedrick, C. RFC 1058: Routing Information Protocol (1988) — distance-vector, hop-count metric, maximum 15 hops. rfc-editor.org/rfc/rfc1058.
- Moy, J. RFC 2328: OSPF Version 2 (1998) — link-state operation and SPF. rfc-editor.org/rfc/rfc2328.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.