The routing table is the decision engine of every router. The CCNA 200-301 exam presents `show ip route` output and asks you to determine where a packet will be forwarded, which route wins when multiple entries match, and what each code letter means. You need to know administrative distance (AD), metrics, longest prefix match, and how connected, static, and dynamic routes appear in the table. This guide covers all of it.
Practice this topic
The `show ip route` command displays the IP routing table. Each line represents a known route. The format is: Code, then network/prefix, then administrative distance/metric in brackets, then via next-hop or outgoing interface.
Example: `O 10.1.2.0/24 [110/20] via 192.168.1.1, 00:05:23, GigabitEthernet0/0` — O = OSPF route, 10.1.2.0/24 = destination network, [110/20] = AD 110 / metric 20, via 192.168.1.1 = next-hop IP, 00:05:23 = time since learned, GigabitEthernet0/0 = outgoing interface.
Common route codes: C = connected (directly attached network), L = local (the router's own interface IP as a /32 host route), S = static, O = OSPF, D = EIGRP, R = RIP, B = BGP, i = IS-IS, * = default route candidate. A route with `*` is a candidate for the default route when no more specific match exists.
Administrative distance (AD) is the trustworthiness rating of a routing information source. Lower AD is more trusted. When two routing sources provide a route to the same destination, the route with the lowest AD wins and is installed in the routing table.
Key AD values to memorize: Connected = 0 (most trusted), Static = 1, EIGRP summary = 5, External BGP = 20, Internal EIGRP = 90, OSPF = 110, IS-IS = 115, RIP = 120, External EIGRP = 170, Internal BGP = 200. A directly connected route (AD 0) always beats any dynamic routing protocol's version of the same network.
AD is only used to choose between routes to the same destination from different sources. Once a source is chosen, the metric within that protocol determines the best path if multiple routes from the same protocol cover the same network.
Metric measures the cost of reaching a destination within a single routing protocol. Each protocol uses a different metric: RIP uses hop count (maximum 15); OSPF uses cumulative cost based on interface bandwidth (reference bandwidth / interface bandwidth); EIGRP uses a composite metric based on bandwidth and delay; BGP uses AS path length and various policy attributes.
When the same routing protocol has two paths to the same network, the path with the lower metric wins. Equal-cost load balancing occurs when two paths have the same metric — both are installed in the routing table and traffic is distributed across them.
Longest prefix match is how the router selects which route to use for a specific packet. The router compares the destination IP against all routing table entries and selects the entry with the longest matching prefix (most specific). A /28 route beats a /24 route beats a /0 default route, even if the /0 has better AD or metric. Specificity always wins over AD and metric.
Connected routes (C) appear automatically when an interface is configured with an IP address and is in an up/up state. The router knows it can directly reach that subnet without any routing protocol. Connected routes have AD 0.
Local routes (L) are /32 host routes for the router's own interface IP addresses. They're used to efficiently identify traffic destined for the router itself (to a router's interface) rather than traffic transiting the router.
Static routes (S) are manually configured: `ip route <network> <mask> <next-hop or interface>`. A static route with a next-hop IP is a recursive static route — the router must look up the next-hop IP in the routing table. A static route with an outgoing interface is a directly connected static route. Floating static routes use a higher-than-normal AD (e.g., AD 5 for a backup to OSPF) so they only appear if the dynamic route is removed.
The default route (S* or O* etc.) matches any destination when no more specific route exists: `ip route 0.0.0.0 0.0.0.0 <next-hop>`. It appears in the routing table as 0.0.0.0/0.
| Source | AD | Notes |
|---|---|---|
| Connected | 0 | Most trusted; direct interface |
| Static | 1 | Manually configured |
| EIGRP summary route | 5 | Auto-summary routes |
| External BGP (eBGP) | 20 | Routes from other ASes |
| Internal EIGRP | 90 | |
| OSPF | 110 | Most common IGP |
| IS-IS | 115 | |
| RIP | 120 | Hop count, max 15 |
| External EIGRP | 170 | Routes redistributed into EIGRP |
| Internal BGP (iBGP) | 200 | Least trusted dynamic source |
The route with the best metric always wins
Longest prefix match takes absolute priority. Then AD determines which routing source wins. Metric only breaks ties within the same routing protocol. A /30 OSPF route always beats a /24 static route for a specific /30 destination.
A static route with AD 1 always overrides dynamic routes
Only if the static and dynamic routes cover the exact same network prefix. Longest prefix match is evaluated first — a more specific dynamic route wins over a less specific static route regardless of AD.
Connected routes must be configured manually
Connected routes appear automatically when a router interface is configured with an IP address and the interface is up/up. No routing protocol or manual configuration is needed.
These questions are representative of what you will see on CCNA exams. The correct answer and explanation are shown immediately below each question.
A router has two routes to 10.1.0.0/16: one from OSPF and one from RIP. Which route is installed in the routing table?
Explanation: When two routing protocols provide a route to the same destination, the route with the lowest administrative distance wins. OSPF AD = 110; RIP AD = 120. The OSPF route is installed. Metric is only compared within the same protocol.
A routing table has these entries: 10.0.0.0/8 (static), 10.1.0.0/16 (OSPF), 10.1.1.0/24 (EIGRP). A packet arrives for 10.1.1.50. Which route is used?
Explanation: Longest prefix match selects the most specific route. 10.1.1.0/24 has the longest prefix that matches 10.1.1.50 (/24 > /16 > /8). The protocol (EIGRP) doesn't matter — specificity wins.
Which route code in `show ip route` represents a route to the router's own interface IP address as a /32?
Explanation: L (Local) routes are /32 host routes automatically installed for the router's own interface IP addresses. C (Connected) routes represent the entire subnet of a directly attached interface.
A network engineer configures a static route with AD 200 as a backup for an OSPF route (AD 110). When will the static route appear in the routing table?
Explanation: This is a floating static route. With AD 200, it's less trusted than OSPF (AD 110), so the OSPF route wins and the static route is not installed. If the OSPF route disappears (link failure, neighbor loss), the static route (AD 200) is installed as a backup.
What does the entry `Gateway of last resort is 203.0.113.1 to network 0.0.0.0` indicate?
Explanation: The 'Gateway of last resort' line shows the default route destination. 0.0.0.0/0 is the default route — it matches any destination when no more specific route exists. The router will forward unmatched packets to 203.0.113.1.
Administrative distance (AD) is a number from 0–255 that rates the trustworthiness of a routing information source. When multiple routing sources know a route to the same destination, the source with the lowest AD wins. Connected routes (AD 0) always beat static (AD 1) and dynamic routes. OSPF (AD 110) beats RIP (AD 120).
Longest prefix match is the router's rule for selecting which routing table entry applies to a packet. The route with the most specific (longest) prefix that matches the destination IP is always used, regardless of AD or metric. A /30 route always beats a /24 or /0 route for a destination that falls within all three.
A floating static route is a static route configured with a higher-than-normal AD so it doesn't appear in the routing table while a more trusted dynamic route (lower AD) exists. If the dynamic route fails, the floating static route automatically becomes active. It's a simple backup/failover mechanism without requiring routing protocol convergence.
A Connected (C) route represents the entire subnet of a directly attached interface — e.g., 192.168.1.0/24. A Local (L) route is a /32 host route for the router's own interface IP — e.g., 192.168.1.1/32. Local routes help the router efficiently process traffic destined for its own interfaces.
Cisco assigned these AD values based on general trust assessments of each protocol's convergence and reliability. EIGRP (AD 90) was considered more trustworthy than OSPF (AD 110) in Cisco's design. This doesn't mean EIGRP is always better — it means in a network running both, EIGRP routes are preferred when they cover the same destination.
Try free Routing Table practice questions with explanations, topic links and progress tracking.