The routing table
Read every component of a routing table entry: protocol codes, prefix and mask, next hop, administrative distance, metric and the gateway of last resort.
Anatomy of a route entry
Every show ip route entry is a forwarding instruction: a protocol code (where the route came from), a destination prefix and mask, an administrative distance and metric in brackets, a next-hop address and/or exit interface, and how long the route has been known.
Codes: C - connected, S - static, O - OSPF, D - EIGRP, R - RIPThe first letter(s) identify the route source.S* 0.0.0.0/0 [1/0] via 10.0.0.2* marks the gateway of last resort candidate.O 10.2.0.0/24 [110/20] via 10.0.0.2, 00:12:31, Gi0/1OSPF route, AD 110, metric 20.C 10.0.0.0/30 is directly connected, Gi0/1Connected — installed automatically with AD 0.L 10.0.0.1/32 is directly connected, Gi0/1Local — the router's own interface address.The next hop is the IP the packet goes to on the local link (the router resolves it via ARP/ND). The metric (the second bracket number) compares routes inside one protocol — OSPF cost, EIGRP composite, RIP hop count. It means nothing across protocols. The gateway of last resort is the default route the router uses when nothing else matches.
Protocol codes and ADs
Routing table protocol codes
| Code | Source | Meaning |
|---|---|---|
| C | Connected | Network of an up interface |
| L | Local | The interface's own /32 host route |
| S | Static | Manually configured |
| S* | Static default | Candidate gateway of last resort |
| O | OSPF | Intra/inter-area link-state route |
| O IA | OSPF inter-area | Route learned from another OSPF area |
| D | EIGRP | Internal EIGRP route |
| D EX | EIGRP external | Redistributed into EIGRP |
| R | RIP | Distance-vector RIP route |
| B | BGP | Border Gateway Protocol route |
Default administrative distances
| Source | AD | Notes |
|---|---|---|
| Connected | 0 | Cannot be beaten — same prefix always wins |
| Static | 1 | Floating statics raise this deliberately |
| eBGP | 20 | External BGP (context) |
| EIGRP (internal) | 90 | |
| OSPF | 110 | |
| RIP | 120 | |
| iBGP | 200 | Peers within the same AS (BGP interior sessions) |
| Unreachable | 255 | Route is never installed |
Lower is preferred — but AD compares candidate routes for the SAME prefix, never for different prefixes.
- Line
- O 10.2.0.0/24 [110/20] via 10.0.0.2, 00:12:31, GigabitEthernet0/1
- O → learned via OSPF.
- 10.2.0.0/24 → destination prefix and mask.
- [110/20] → AD 110 (OSPF), metric 20 (cost to reach it).
- via 10.0.0.2 → next-hop IP; Gi0/1 → exit interface.
One line tells you the source, destination, confidence, cost, and where the packet exits.
Gateway of last resort
Common mistakes
- Reading [110/20] as 'priority/cost' vs 'AD/metric' — memorize the order.
- Using AD to choose between different-length prefixes — AD only decides between identical prefixes from different sources.
- Ignoring the local (L) route — it's why the router answers on its own address.
- Confusing metric across protocols — OSPF cost 20 and RIP hop 20 are unrelated numbers.
Observation: The route exists in the table; packets still fail.
- Next hop unreachable (underlying link down)
- A more-specific route blackholes the traffic
- Return path missing on the far side
| Check | Indicates |
|---|---|
| Ping the next-hop IP | Unreachable next hop means the exit/link is down despite the route entry. |
| Look for a more-specific matching route | A longer prefix beats your expected route regardless of source. |
| Trace from the far end back | Outbound path exists but replies cannot return. |
Correction: Restore next-hop reachability or fix the more-specific/return routing.
Traffic flows and the traceroute follows the expected path.
Related resources
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- Cisco — IP Addressing Services Command Reference — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.