BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Static Routing

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/2

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
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 resortWhere 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.2The next-hop address. The router must also be able to reach it, normally through a connected route.
00:14:32How long a dynamic route has been in the table. A route that keeps resetting to 00:00:xx is flapping.
is variably subnettedA 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

Learn it in the CCNA path

Topic

Static Routing — Read the routing table, add static and default routes in both directions, and prove reachability with ping and traceroute.

All 57 commands