show ip route Explained for CCNA: Reading the Routing Table
show ip route is the most important troubleshooting command in network engineering. Understanding every element of its output is a CCNA exam requirement and a daily operational skill. This guide covers everything you need to know.
Basic show ip route Output
Router# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
Gateway of last resort is 10.0.0.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.0.0.1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/0
L 10.0.0.2/32 is directly connected, GigabitEthernet0/0
O 192.168.1.0/24 [110/2] via 10.0.0.1, 00:05:43, GigabitEthernet0/0
S 172.16.0.0/16 [1/0] via 10.0.0.1
Understanding the Route Codes
The letter at the start of each route line tells you the source:
| Code | Source |
|---|---|
| C | Connected (directly attached network) |
| L | Local (the interface's own IP as /32) |
| S | Static route (manually configured) |
| O | OSPF route |
| D | EIGRP route |
| R | RIP route |
| B | BGP route |
| * | Default route candidate |
Key CCNA point: C and L routes always exist for each configured interface. L routes are /32 host routes for the interface's exact IP — IOS uses these to process packets destined TO the router itself.
Reading the Administrative Distance and Metric
Every non-connected route shows [AD/metric] in brackets:
O 192.168.1.0/24 [110/2] via 10.0.0.1
^^^ ^
AD Metric
Administrative Distance (AD) = trustworthiness of the routing source. Lower wins.
| Source | AD |
|---|---|
| Connected | 0 |
| Static | 1 |
| EIGRP | 90 |
| OSPF | 110 |
| RIP | 120 |
| External EIGRP | 170 |
| Unknown / unreachable | 255 |
Metric = cost within the routing protocol:
- OSPF metric = interface cost (default: reference bandwidth / interface bandwidth)
- EIGRP metric = composite formula using bandwidth + delay
- RIP metric = hop count (1-15, 16 = infinity/unreachable)
- Static routes = metric 0 (no cost calculation)
The Default Route
Gateway of last resort is 10.0.0.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.0.0.1
This is the default route — traffic with no more-specific match in the routing table is forwarded here. The * marks it as a "candidate default" route.
"Gateway of last resort is not set" means no default route is configured — traffic to unknown destinations is dropped.
CCNA exam scenario: A host can reach local resources but not the internet. The router shows "Gateway of last resort is not set" — fix: add a static default route: ip route 0.0.0.0 0.0.0.0 <next-hop-ip>
Variably Subnetted Output
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/0
L 10.0.0.2/32 is directly connected, GigabitEthernet0/0
This means the 10.0.0.0/8 network has routes with different prefix lengths (/30 and /32) — VLSM is in use. The parent route line (10.0.0.0/8) is not a route itself, just a grouping header.
Longest Prefix Match
When multiple routes could match a destination, IOS uses longest prefix match — the route with the most specific (longest) prefix length wins.
Example:
- S 0.0.0.0/0 via 10.0.0.1 (default)
- O 192.168.0.0/16 via 10.0.0.1
- S 192.168.1.0/24 via 10.0.0.2
Traffic to 192.168.1.100 matches all three, but /24 is longest — uses 10.0.0.2 next-hop.
Equal-Cost Load Balancing
When two routes have identical AD and metric:
O 10.1.1.0/24 [110/2] via 10.0.0.1, GigabitEthernet0/0
[110/2] via 10.0.0.2, GigabitEthernet0/1
IOS installs both and load-balances traffic (CEF per-destination by default, per-packet optionally).
OSPF supports equal-cost load balancing up to 16 paths (default 4). EIGRP supports unequal-cost load balancing with the variance command.
Common CCNA Troubleshooting Scenarios
Scenario 1: Route exists but traffic doesn't flow
- Check ACLs on the path:
show access-lists - Check the interface is up:
show ip interface brief - Verify the next-hop is reachable:
ping <next-hop>
Scenario 2: Route not in routing table
- Check routing protocol adjacency:
show ip ospf neighbororshow ip eigrp neighbors - Check if the network is being advertised:
show running-config | section router - Check for mismatched subnet masks or authentication
Scenario 3: Wrong route in table (from wrong source)
- Compare ADs — a static route (AD 1) always beats OSPF (AD 110)
- Remove conflicting static route or redistribute as needed
Practice with show ip route on Courseiva
Master routing table interpretation with practice questions: