PracticeLabs
Week 5Lesson 1Required42 min estimated0% progress

Reading show ip route

Read a full show ip route output field by field — codes, prefix length, AD and metric, next hop, timers — and predict the exact line the router uses to forward a given destination.

Lesson orientation

What you'll learn (5 objectives)~42 min: video → lesson → check → apply → lab prep

Learning objectives

  • Identify every field in a route line: code, prefix, AD, metric, next hop, age, exit interface
  • Distinguish connected from local routes and explain why the /32 local route exists
  • Read the gateway of last resort and the S* candidate-default line correctly
  • Apply longest-prefix match, then administrative distance, to name the single forwarding line
  • Diagnose a route that is present in the table but still fails to forward

Terms you will see

RIBRoute codeCandidate defaultGateway of last resortLocal routeVariably subnettedRecursive lookup

Time breakdown

  • Read the notes20 min
  • Routing Table Trainer14 min
  • Reading practice8 min

Assigned video

Opens on YouTube
Optional video

Routing Fundamentals (Day 11 part 1)

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~6 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • The router walking the table for the longest matching prefix before forwarding

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

The table is a decision already made

show ip route is not a list of everything the router has heard. It is the RIB — the set of winning routes after longest-prefix match, administrative distance, and metric have already been applied. Every line that survived is a route the router is willing to use right now. Reading it well means reading one line at a time and knowing what each column means.

One line, six pieces of information
O    10.1.8.0/26 [110/30] via 10.1.12.2, 00:14:32, GigabitEthernet0/1
|    |           |        |              |         |
|    |           |        |              |         +- exit interface
|    |           |        |              +- age (14m 32s since last update)
|    |           |        +- next-hop IP (who to forward to)
|    |           +- [administrative distance / metric]
|    +- destination prefix and length
+- route code (how it was learned): O = OSPF intra-area
What each field compares
FieldMeaning
CodeMaps to the legend above the table: C connected, L local, S static, O OSPF, D EIGRP, B BGP, R RIP. A trailing * marks a candidate default.
Prefix / lengthThe network and its mask. The length is what longest-prefix match compares.
[AD/metric]Before the slash is administrative distance — trust in the source. After it is the metric — cost within that source. [110/30] is 'OSPF, path cost 30'.
via next-hopThe address the packet is handed to next.
AgeHow long the route has been in the table — useful for spotting a route that just flapped.
Exit interfaceThe local interface the frame leaves through.

Two lines per interface

One addressed, up/up interface
C        10.1.1.0/24 is directly connected, GigabitEthernet0/0
L        10.1.1.1/32 is directly connected, GigabitEthernet0/0

The C route is the subnet reachable out that interface. The L route is the router's own address as a /32 host route, which lets the router recognise traffic destined to itself and answer it rather than forward it. Both carry AD 0. Beginners often read the L line as a duplicate; it is a distinct, deliberate entry, and Week 4 Lesson 2 covered why.

Reading 'variably subnetted, 6 subnets, 3 masks'
That header appears above a major network when the router holds several subnets of it using different mask lengths — a /24 LAN, a /30 point-to-point link, and /32 locals, for instance. It is informational: it tells you the table contains VLSM entries under one classful parent, which is why a /24 and a /26 and a /32 can all sit indented beneath 10.0.0.0/8. Count the distinct lengths to check yourself.

The gateway of last resort, and what beats it

A default route and its banner
Gateway of last resort is 10.1.12.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.1.12.2

0.0.0.0/0 matches everything, but with a prefix length of zero it is the shortest possible match, so it is used only when no more specific route matches. The asterisk flags it as the candidate default, and IOS echoes that as the gateway-of-last-resort line. If no default is installed the line reads 'not set', and unmatched packets are dropped.

AD is a tiebreaker for equal prefix lengths only
Because administrative distance is only compared when two sources offer the same prefix length, a /26 OSPF route with AD 110 beats a /24 static route with AD 1 for any address inside that /26. The longer prefix wins outright and AD never enters the comparison. This is the single most tested idea in the table, and it is the same rule Week 4 Lesson 5 established — here you apply it by eye to live output.

Reading a complete table

R1# show ip route
Gateway of last resort is 10.1.12.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.1.12.2
      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
C        10.1.1.0/24 is directly connected, GigabitEthernet0/0
L        10.1.1.1/32 is directly connected, GigabitEthernet0/0
C        10.1.12.0/30 is directly connected, GigabitEthernet0/1
L        10.1.12.1/32 is directly connected, GigabitEthernet0/1
O        10.1.4.0/24 [110/20] via 10.1.12.2, 00:14:32, GigabitEthernet0/1
O        10.1.8.0/26 [110/30] via 10.1.12.2, 00:14:32, GigabitEthernet0/1

Read top to bottom: R1 has a static default to 10.1.12.2, its gateway of last resort. It is directly connected to its LAN 10.1.1.0/24, with its own address as the /32 local, and to the 10.1.12.0/30 link toward R2. It has learned two networks via OSPF through R2 — the 10.1.4.0/24 LAN at cost 20 and a 10.1.8.0/26 subnet at cost 30. Everything else in the world falls to the default.

Troubleshooting — a route configured but never installed
Symptom: you add ip route 10.1.20.0 255.255.255.0 10.9.9.9, expect traffic to 10.1.20.5 to work, and it is black-holed — the route never appears in show ip route at all. Diagnosis: 10.9.9.9 is on no connected subnet and is itself absent from the table, so the recursive lookup that resolves the next hop has nothing to land on and IOS declines to install the route. show ip route 10.1.20.0 returns '% Network not in table'. Fix: point the static at a next hop that is genuinely reachable — a directly connected address such as 10.1.12.2 — or specify the exit interface, then re-verify.

Verify the same way every time. show ip route <destination> prints the single line that will forward that address, or tells you no route matches. That one command turns 'reading the whole table' into 'confirm the winner'.

What you should retain

  • One line is: code, prefix and length, [AD/metric], via next hop, age, exit interface.
  • C is the subnet on an up/up interface; L is the router's own address as a /32. Both are AD 0.
  • S* and the gateway-of-last-resort banner mark the default route, used only when nothing more specific matches.
  • Selection order: longest-prefix match first, then AD for equal-length ties, then metric within one protocol.
  • show ip route <destination> prints the exact winning line, or reports it is not in the table.
Pause and predictNot scored — nothing is recorded

Before you read on

Using the table above, name the exact line that forwards each packet: (1) 10.1.4.9 (2) 10.1.8.70 (3) 10.1.1.1, the router's own interface address.

Interactive tool
Required~14 min

Routing Table Trainer

Read each generated IOS-style table and pick the forwarding path. Force yourself to say the winning prefix length out loud before answering — that habit is what stops the /26-versus-/24 trap from catching you under time pressure.

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

Routing Protocols

For the complete route-code legend and further worked show ip route lines beyond the two tables here