A router makes one decision over and over, millions of times a second: which way to send this packet. The routing table is how it decides, and show ip route is how you read that decision for yourself. Every routing topic that follows, static routes, OSPF, troubleshooting, comes back to this one screen, so reading it fluently is the single most useful skill in the whole IP Connectivity domain.
This breaks down a real Cisco routing table line by line: the source codes, the numbers in brackets, why one route beats another, and how the router actually picks a path for a packet. If the routing protocols themselves are still hazy, the IP routing and routing protocols overview covers those; here the focus is the table. Captured on Cisco IOS 15.2 in June 2026, on two c7200 routers in GNS3.
What the routing table holds
The table is built from three kinds of routes: networks the router is directly connected to, static routes you type in, and routes learned from a dynamic protocol like OSPF. Each line starts with a one or two letter code naming its source. The legend prints at the top of every show ip route, and the codes that matter for the CCNA are a short list: C connected, L local, S static, and O for OSPF.
The lab behind this is two routers, R1 and R2, joined by a /30 and running OSPF in area 0. Each has a couple of loopbacks, and R1 also carries a static route and a default route, so its table shows every CCNA code at once.

That topology was built and captured on two c7200 routers in GNS3:

Here are the route codes you will actually meet, with what each one means:
| Code | Source |
|---|---|
| C | Directly connected network (an up/up interface with an IP) |
| L | Local: the /32 host route for the router’s own interface address |
| S | Static route you configured |
| O | Learned from OSPF (D is EIGRP, R is RIP, B is BGP) |
| S* | A static default route, the candidate default |
Reading a single route line
Run the command on R1 and the whole table prints under the legend:
show ip route
Every code from the table above shows up in the real output:

Take one line: O 192.168.20.0/24 [110/2] via 10.0.12.2, 00:00:09, GigabitEthernet0/0. Read it left to right. O is the source: OSPF learned it. 192.168.20.0/24 is the destination network and its prefix length. The bracket [110/2] is the part people misread, so it is worth committing to memory: it is always [administrative distance / metric]. So 110 is the administrative distance (OSPF’s default) and 2 is the OSPF metric. After via comes the next-hop address, then how long the route has been in the table, then the interface the router will send the packet out of.
Administrative distance: which source wins
Administrative distance answers a single question: when two different sources offer a route to the same network, which one does the router believe? Lower is more trusted. A directly connected network (AD 0) always beats a static (1), which beats OSPF (110), which beats RIP (120). The router installs only the winner in the table.
| Route source | Default administrative distance |
|---|---|
| Connected | 0 |
| Static | 1 |
| External BGP (eBGP) | 20 |
| EIGRP (internal) | 90 |
| OSPF | 110 |
| RIP | 120 |
| Internal BGP (iBGP) | 200 |
| Unusable | 255 |
This is why the static route to 203.0.113.0/24 in the lab sits in the table as an S with AD 1. If OSPF later learned the same prefix, the static would still win on its lower distance.
Metric: which route within a protocol
Administrative distance only compares different sources. When a single protocol knows two routes to the same network, AD is identical, so the tie breaks on the metric, the protocol’s own measure of cost. Lower wins. OSPF derives its metric from bandwidth (it calls it cost), EIGRP uses a bandwidth-and-delay composite, and RIP just counts hops. In the bracket [110/2], the 2 is that OSPF cost.
Longest-prefix match: how the router actually forwards
Here is the part that trips people up, because it is a different rule from the two above. Administrative distance and metric decide which route to install for a given prefix. But when an actual packet arrives, the router chooses among the installed routes by longest-prefix match: the most specific route that matches the destination wins, regardless of AD or metric.
If the table holds both 192.168.20.0/24 and a default 0.0.0.0/0, a packet to 192.168.20.5 follows the /24, because /24 is a longer (more specific) match than /0. The default route is the loosest possible match, so it only catches packets that nothing more specific does. Order of operations: longest-prefix match first to choose among different prefixes, then lowest AD and lowest metric only to settle competing routes to the same prefix.
The gateway of last resort
At the top of the lab table is the line Gateway of last resort is 10.0.12.2 to network 0.0.0.0, paired with an S* 0.0.0.0/0 [1/0] via 10.0.12.2 entry. That is the default route. It matches any destination, but as the loosest possible prefix it is used only when no specific route fits. Most edge routers point a default at the next hop toward the internet, so anything not in the table heads that way instead of being dropped.
Inspecting one route
The table is the summary. To see everything the router knows about one destination, add the prefix to the command:
show ip route 192.168.20.0
That expands into the full record for the route, including the source, the distance and metric, and where it was learned:

The detail spells out what the one-line entry compresses: Known via "ospf 1", distance 110, metric 2, type intra area, and the descriptor block naming the next hop and exit interface. When a route is in the table but traffic still fails, this is the command that shows you whether the router learned it the way you expected. The neighbor output below confirms the OSPF adjacency that fed it is fully up.
Practice the Cisco routing table
The two-router OSPF lab is paste-ready for GNS3, Cisco Packet Tracer, or real gear in the companion repo: c4geeks/ccna-labs. Build R1 and R2, paste the configs, and show ip route fills in exactly as above. It assumes the routers already have their base configuration and IP addressing in place; if subnets and masks are shaky, review IPv4 addressing first. The routing table is the foundation of the IP Connectivity domain on the CCNA 200-301 study roadmap.
Test the codes, the distance-versus-metric distinction, and longest-prefix match with the quiz:
Then drill the route codes and the administrative distance values with the flashcards, or load the deck into Anki:
Three ways the routing table trips people up
Most routing-table mistakes come from confusing the three selection rules. Keep them straight:
- Reading the bracket backwards.
[110/2]is [AD/metric], not [metric/AD]. The first number is always the administrative distance. - Thinking the lowest AD forwards the packet. AD and metric only decide which route gets installed for a prefix. The packet itself follows longest-prefix match, so a /24 with a high metric still beats a /0 default.
- Expecting an OSPF loopback to appear with its real mask. OSPF advertises loopbacks as /32 host routes by default. The lab sets
ip ospf network point-to-pointon the loopback so 192.168.20.0 shows up as the /24 you configured.
Get those three straight and show ip route stops being a wall of text. It becomes the first place you look, on every routing problem you will ever troubleshoot.