CCNA Study GuideCCNA 200-301

How to Read show ip route Output in CCNA Questions

Every routing table question in the CCNA follows the same logic: longest prefix match wins, then lowest AD, then lowest metric. Here is how to read any show ip route output and find the right answer in under 30 seconds.

8 min read
13 sections
Courseiva Study Hub

Quick answer

Every routing table question in the CCNA follows the same logic: longest prefix match wins, then lowest AD, then lowest metric. Here is how to read any show ip route output and find the right answer in under 30 seconds.

Why show ip route questions are everywhere

The show ip route command is on the CCNA because routing decisions are the core of what routers do. If you understand how a router reads its own routing table, you can answer questions about traffic paths, missing routes, default routes, administrative distance, and OSPF convergence — all from the same exhibit.

The exam does not ask you to type the command. It gives you the output and asks you to interpret it.

Reading the output line by line

Here is a typical routing table section:

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 203.0.113.1
      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
C        10.1.1.0/30 is directly connected, Serial0/0/0
L        10.1.1.1/32 is directly connected, Serial0/0/0
C        10.1.2.0/24 is directly connected, GigabitEthernet0/0
O        10.1.3.0/24 [110/65] via 10.1.1.2, 00:12:44, Serial0/0/0
O IA     10.2.0.0/16 [110/128] via 10.1.1.2, 00:12:44, Serial0/0/0

Source codes: C = connected, L = local (the router's own interface address), S = static, O = OSPF intra-area, O IA = OSPF inter-area. An asterisk (*) marks the default route candidate.

Bracket notation [AD/metric]: The first number is the administrative distance. The second is the metric. For OSPF, the AD is always 110. For static routes, it is 1. For connected routes, it is 0. Lower AD wins when the same prefix is reachable via multiple sources.

Gateway of last resort: If a packet matches no specific route, the router uses this. "Gateway of last resort is not set" means the router will drop unmatched packets.

The three routing decision rules in order

  1. Longest prefix match: A /30 beats a /24 beats a /16 beats the default /0. Always.
  2. Lowest administrative distance: If two sources have routes to the same prefix with the same length, lowest AD wins (connected = 0, static = 1, OSPF = 110).
  3. Lowest metric: If two routes have the same prefix and the same AD (e.g., two OSPF paths), the one with the lower metric wins.

The exam tests all three. Most questions that mention "which route will be used?" are testing rule 1. Questions that mention both a static route and an OSPF route to the same destination are testing rule 2.

Common exam traps in routing table questions

Trap 1: Confusing AD with metric. In [110/65], 110 is the AD and 65 is the metric. Questions that ask "what is the administrative distance of this route?" expect 110. Questions that ask "what is the OSPF cost?" expect 65.

Trap 2: Ignoring the L (local) routes. Local routes (/32) represent the router's own interface IP. They are not used to forward traffic to other hosts. If the question asks which route is used to reach 10.1.1.2 from this router, the L route for 10.1.1.1/32 does not help — the C route for 10.1.1.0/30 is the match.

Trap 3: Missing default route. If the routing table has no default route and no specific route for a destination, the router drops the packet. The exhibit will not shout this at you — you have to notice the absence.

Trap 4: O IA vs O. OSPF inter-area routes (O IA) have the same AD (110) as intra-area routes. They are not less preferred by default. The difference matters for topology questions about area design, not route selection.

Worked example

A question shows this output and asks: "Which route will R1 use to reach 10.1.3.50?"

O     10.1.3.0/24  [110/65] via 10.1.1.2
O     10.1.0.0/16  [110/30] via 10.1.1.2
S*    0.0.0.0/0    [1/0] via 203.0.113.1

Apply rule 1: longest prefix match. 10.1.3.50 falls in 10.1.3.0/24 (a /24) and also in 10.1.0.0/16 (a /16). The /24 is longer — it wins. R1 uses the OSPF route via 10.1.1.2.

If the /24 route did not exist, the /16 would win. If neither existed, the default route would be used.

Practice this topic

Work through CCNA routing and switching questions on Courseiva to drill routing table interpretation in a timed environment. The OSPF topic guide covers how OSPF routes are calculated and what metric values mean in practice.

Frequently asked questions

What does "variably subnetted" mean in the output? It means the major network (like 10.0.0.0/8) is divided into subnets of different sizes. This is VLSM in action — it is informational and does not change how routing decisions work.

Can two routes with different ADs share the same prefix? Yes, but only the lower-AD route is installed in the routing table. The other is in the routing protocol's database but not used for forwarding. This is why a static route (AD 1) beats an OSPF route (AD 110) to the same prefix.

What does "is directly connected" mean? The router has an interface on that network. No routing is needed — the router already knows how to reach it. Connected routes have AD 0 and cannot be beaten by any other source.

A Full Routing Table — Every Element Annotated

This is what a multi-source routing table looks like. Walk through it line by line:

R1# show ip route

Codes: C - connected, S - static, O - OSPF, D - EIGRP, L - local

Gateway of last resort is 203.0.113.1 to network 0.0.0.0

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.1.1.0/24 is directly connected, GigabitEthernet0/0
L       10.1.1.1/32 is directly connected, GigabitEthernet0/0
O       10.2.2.0/24 [110/2] via 10.1.1.2, 00:45:12, GigabitEthernet0/0
S       10.3.0.0/16 [1/0] via 10.1.1.3
D       192.168.5.0/24 [90/2170112] via 10.1.1.4, 02:10:00, GigabitEthernet0/0
S*      0.0.0.0/0 [1/0] via 203.0.113.1

"Gateway of last resort is 203.0.113.1" — A default route exists. Any destination not matched by a more specific route gets forwarded to 203.0.113.1.

"10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks" — Multiple subnets of the same major network with different prefix lengths. Not an error. Just a grouping header confirming VLSM is in use.

C 10.1.1.0/24 — Directly connected network. IOS creates this automatically when the interface has an IP address in that range and is in up/up state.

L 10.1.1.1/32 — Local route. IOS creates a /32 host route for the router's own interface IP. This tells the router to process packets destined for 10.1.1.1 locally rather than forwarding them. Do not confuse L routes with manually added host routes.

O 10.2.2.0/24 [110/2] — Learned via OSPF. AD = 110, metric (cost) = 2. "via 10.1.1.2" is the next-hop. "00:45:12" is how long since the last update. "GigabitEthernet0/0" is the outgoing interface.

S 10.3.0.0/16 [1/0] — Static route. AD = 1, metric = 0. This is a /16 summary. If a packet is destined for 10.3.5.100 and an OSPF /24 route to 10.3.5.0/24 also exists, the OSPF /24 wins — longer prefix match takes priority over lower AD.

S 0.0.0.0/0* — The asterisk marks this as the candidate default route. This is what "Gateway of last resort" points to.

What the Variably Subnetted Line Means

"X.X.0.0/Y is variably subnetted, N subnets, M masks" appears whenever multiple entries from the same major classful network exist with different prefix lengths. It is informational only. If you see it, VLSM is in use — that is all. It does not indicate a routing problem.

Candidates sometimes mistake this line for an error or an extra route entry. It is not. It is just a header that IOS uses to group related subnets.

Connected vs Local Routes — The /32 Trap

Every interface with a configured IP generates two automatic routing table entries: a C route for the network, and an L route for the exact interface IP address at /32.

The L route is for the router itself. When traffic arrives destined for 10.1.1.1, the router matches the /32 local route and knows the packet is for one of its own interfaces — it processes it rather than forwarding it.

Exam trap: a question shows a routing table with a /32 entry and asks what it represents. If it shows the L code, it is a local route for the router's own interface. If it shows S (static) with a /32, it is a manually configured host route to a specific remote host. Different things, different answers.

Floating Static Routes — The Backup Route Pattern

A floating static route has an artificially high AD. The router installs it only when the primary route is gone.

ip route 10.2.2.0 255.255.255.0 10.1.1.3 130

This static route has AD = 130. OSPF's AD is 110. While OSPF is advertising 10.2.2.0/24 (AD 110), this static route stays out of the routing table. If OSPF loses the route, the static route takes over as backup.

The exam asks: "Which configuration would ensure a static route is only used if OSPF fails?" — A static route with AD greater than 110 is the answer (for example, AD 130).

OSPF Equal-Cost Multi-Path

When OSPF learns two paths to the same destination with identical cost, it installs both in the routing table and load-balances between them. In show ip route you see the destination listed twice:

O    192.168.10.0/24 [110/2] via 10.1.1.2, GigabitEthernet0/0
                     [110/2] via 10.1.1.3, GigabitEthernet0/1

By default, OSPF supports up to four equal-cost paths. Traffic is load-balanced per-packet or per-destination depending on the platform configuration.

Practice Question Sets

The only way to build genuine speed on CCNA questions is reps under realistic conditions. Pick a session size that fits your schedule:

Session Questions Estimated time Link
Quick check 10 10-12 min Start
Standard session 20 20-25 min Start
Focused drill 30 30-40 min Start
Deep study block 50 50-65 min Start
Full mock exam 120 2-2.5 hours Start

Practise CCNA questions

Original exam-style practice questions with detailed, explained answers. Track your weak topics and review missed questions before exam day.

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.