show ip route
Shows the IPv4 routing table: every network the router can reach, how it learned it, and the next hop or exit interface.
Written by a working field network engineer · CCNA, Security+, CySA+
The routing table is the router’s forwarding decision written down. Every packet is matched against it by longest prefix; if no entry and no default route matches, the packet is dropped. Reading it fluently is the core CCNA routing skill.
Example output
R1#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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is 203.0.113.1 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, 2 subnets, 2 masks
C 10.0.12.0/30 is directly connected, GigabitEthernet0/1
L 10.0.12.1/32 is directly connected, GigabitEthernet0/1
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
O 192.168.20.0/24 [110/2] via 10.0.12.2, 00:14:32, GigabitEthernet0/1
203.0.113.0/24 is variably subnetted, 2 subnets, 2 masks
C 203.0.113.0/29 is directly connected, GigabitEthernet0/2
L 203.0.113.2/32 is directly connected, GigabitEthernet0/2Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.
Useful variants
sh ip roshow ip route 192.168.20.21show ip route connectedshow ip route | begin Gateway
What each column or field means
| Field | Meaning |
|---|---|
Code (C, L, S, O, S*) | How the route was learned. C connected network, L the router’s own address (/32), S static, O OSPF, and * marks the candidate default. |
Gateway of last resort | Where packets go when nothing more specific matches. “is not set” means unmatched packets are dropped. |
[110/2] | Administrative distance / metric. AD picks between sources (connected 0, static 1, EIGRP 90, OSPF 110, RIP 120); the metric picks between paths from the same source. |
via 10.0.12.2 | The next-hop address. The router must also be able to reach it, normally through a connected route. |
00:14:32 | How long a dynamic route has been in the table. A route that keeps resetting to 00:00:xx is flapping. |
is variably subnetted | A header grouping subnets of one classful network that use different masks. Not a route itself. |
When it doesn’t look right
A remote network is missing.
No route exists. Add a static route, or check the routing protocol: is the neighbor up (show ip ospf neighbor) and is the network advertised (show ip protocols)?
Ping fails although the route is present.
Check the return path: the far router needs a route back to your source network. Most “one-way” failures are a missing return route.
A static route is configured but not in the table.
Its next hop is unreachable or its exit interface is down, so it is not installed. Fix reachability to the next hop, or check for a typo in the address or mask.
Traffic takes an unexpected path.
Longest prefix wins before AD and metric. A more specific route (a /24 inside a /16) is chosen even if its AD is worse.
Related commands
Try it yourself
- IP Static Routing Setup (Pro)
- Gateway of Last Resort (Pro)
- Specific Routes Alongside a Default (Pro)
- Adding the Missing Return Route (Pro)
- OSPF Single-Area Base (Pro)
- Or build the example network in the free Sandbox
Learn it in the CCNA path
- Routing Fundamentals (3. IP Connectivity)
- Static & Default Routes (3. IP Connectivity)
- Read the routing table and add a default route (3. IP Connectivity)
- Two decisions: install the route, then forward the packet (3. IP Connectivity)
Topic
Static Routing — Read the routing table, add static and default routes in both directions, and prove reachability with ping and traceroute.