Back to Command Reference
Privileged EXECDomain 3.0 / 6.0

show ip route

Displays the current state of the router's IPv4 Routing Information Base (RIB). This table contains all the network paths the router has actively selected as the "best" paths to reach external and locally connected subnets.

Quick Reference

Execution ModeRouter#
Target ComponentThe Routing Table
Filtering Flagsshow ip route [ospf | static | connected]
Related Verificationshow ip protocols

Reading the Output

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
* - candidate default
Gateway of last resort is 203.0.113.1 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       10.20.30.0/24 is directly connected, GigabitEthernet0/0
L       10.20.30.1/32 is directly connected, GigabitEthernet0/0
O       10.55.0.0/16 [110/65] via 192.168.1.2, 00:15:32, Serial0/0/0
S*   0.0.0.0/0 [1/0] via 203.0.113.1

Line Dissection: O 10.55.0.0/16 [110/65] via 192.168.1.2

  • O (The Code):Tells you *how* the router learned this network. "O" stands for OSPF. "C" means the router is physically plugged into it. "S" means an admin typed it manually.
  • 10.55.0.0/16 (The Destination):The remote network the router knows how to reach.
  • [110 / 65] (AD / Metric):
    110 (Administrative Distance): The "trustworthiness" of the protocol (OSPF is 110, Static is 1, EIGRP is 90). Lower is better.
    65 (Metric): The actual calculated cost to reach that specific network. For OSPF, this is the cumulative interface bandwidth cost. Lower is better.
  • via 192.168.1.2 (Next-Hop):The IP address of the neighboring router that traffic should be handed to.

CCNA Exam Gotchas

[!]

The Longest Prefix Match Rule

If the routing table contains a route for 10.0.0.0 /8 (via OSPF) and a route for 10.20.30.0 /24 (via Static), where does a packet destined for 10.20.30.55 go?

It goes to the Static /24 route. The router will always choose the most specific match (the longest subnet mask), entirely ignoring Administrative Distance and Metrics during the forwarding phase. AD and Metrics are only used to put routes into the table; Longest Prefix Match dictates how they are pulled out.

[!]

Local (L) vs. Connected (C)

In older IOS versions, assigning an IP to an interface only generated a 'C' (Connected) route for the subnet. Modern IOS 15+ generates both a 'C' route for the subnet, and an 'L' (Local) route with a /32 mask. The 'L' route represents the exact IP address sitting physically on the router's interface, allowing the router to process packets destined directly for itself more efficiently.