Courseiva
RoutingPrivileged EXEC

show ip route

Verify the routing table has the correct routes for traffic to reach its destination and diagnose routing failures.

Definition: show ip route is a Cisco IOS privileged exec command. Displays the IP routing table showing all known routes, their source protocols, administrative distances, metrics, next-hops, and outgoing interfaces.

Overview

The 'show ip route' command is one of the most fundamental and frequently used commands in Cisco IOS for network engineers. It displays the IP routing table, which contains all known routes (directly connected, static, and dynamic) that the router uses to forward packets. Understanding the routing table is critical for verifying that routes are learned correctly, checking next-hop addresses, and troubleshooting connectivity issues.

The command provides a snapshot of the router's current forwarding decisions, including the route source (e.g., O for OSPF, D for EIGRP, S for static), administrative distance, metric, next-hop IP, and outgoing interface. It is often the first command used when diagnosing reachability problems, as it reveals whether a route exists for a given destination. Alternatives like 'traceroute' or 'ping' test end-to-end connectivity but do not show the routing table itself.

In a broader workflow, 'show ip route' is used after configuring routing protocols (e.g., OSPF, EIGRP) to confirm route exchange, or after adding static routes to verify they appear. It is also used in conjunction with 'show ip protocols' to check routing protocol status and 'debug ip routing' for real-time updates. The command runs in Privileged EXEC mode (enable) and does not affect the running configuration.

Output can be lengthy; use the '|' pipe to filter (e.g., 'show ip route | include 10.0.0.0'). The routing table is built from multiple sources, and the router selects the best route based on administrative distance and metric. This command is essential for CCNA and CCNP candidates to master, as it appears in both exams and real-world troubleshooting scenarios.

Syntax·Privileged EXEC
show ip route [network [mask]] [longer-prefixes] [protocol]

When to Use This Command

  • Confirm a static route or routing protocol has installed a route to a destination
  • Identify the next-hop and exit interface for a specific destination
  • Compare administrative distance when multiple routing protocols are competing for the same prefix
  • Verify default route (0.0.0.0/0) is present and pointing to the correct gateway

Parameters

ParameterSyntaxDescription
A.B.C.DA.B.C.DSpecifies a particular IP address (e.g., 10.0.0.1) to display routing information for that destination only. If omitted, the entire routing table is shown. Common mistake: using a host address instead of a network address; the command will still work but may show the route for the host if a host route exists.
maskA.B.C.DThe subnet mask for the specified IP address (e.g., 255.255.255.0). Used together with the IP address to filter routes for a specific network. If omitted, the command assumes a classful mask. Common mistake: forgetting to include the mask when filtering for a specific subnet, which may yield unexpected results.
bgpbgpDisplays only BGP routes from the routing table. Useful for isolating BGP-learned routes. Common mistake: confusing this with 'show ip bgp' which shows the BGP table, not the routing table.
connectedconnectedDisplays only directly connected routes. Useful for verifying interface IP configurations. Common mistake: assuming connected routes always have a metric of 0; they do, but the administrative distance is 0.
eigrpeigrpDisplays only EIGRP-learned routes. Common mistake: using this parameter when EIGRP is not configured; the output will be empty.
listlist <1-199>Displays routes that match a specific access list number (standard ACL). Useful for filtering routes based on ACL criteria. Common mistake: using an extended ACL number; only standard ACLs are supported.
mobilemobileDisplays mobile routes (rarely used). Common mistake: expecting output in typical networks; mobile routes are uncommon.
odrodrDisplays On-Demand Routing routes (rarely used). Common mistake: confusing with ODR protocol; this parameter shows routes learned via ODR.
ospfospfDisplays only OSPF-learned routes. Common mistake: using this parameter when OSPF is not configured; the output will be empty.
ripripDisplays only RIP-learned routes. Common mistake: using this parameter when RIP is not configured; the output will be empty.
staticstaticDisplays only static routes. Common mistake: forgetting that default routes are also static if configured with 'ip route 0.0.0.0 0.0.0.0'.
vrfvrf <vrf-name>Displays the routing table for a specific VRF instance. Used in MPLS/VPN environments. Common mistake: omitting the VRF name; the command will fail.

Command Examples

Full routing table output

Router# show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1

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
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 Output

Codes: C=connected, L=local (interface IP as /32), S=static, O=OSPF, R=RIP, B=BGP. Brackets [AD/metric] — AD=administrative distance (lower=preferred), metric=protocol cost. Via = next-hop IP.

S* = default candidate route. Gateway of last resort shows the active default route.

Configuration Scenarios

Verify OSPF Route Propagation Between Two Routers

After configuring OSPF on two directly connected routers, you need to verify that routes are being exchanged correctly. This scenario ensures that OSPF adjacencies are formed and routes are installed in the routing table.

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2 R1 Loopback0: 1.1.1.1/32 R2 Loopback0: 2.2.2.2/32

Steps

  1. 1.Step 1: Enter privileged EXEC mode on R1: enable
  2. 2.Step 2: Display the routing table for OSPF routes: show ip route ospf
  3. 3.Step 3: Verify that R2's loopback (2.2.2.2/32) appears with an O prefix and next-hop 10.0.12.2
  4. 4.Step 4: Repeat on R2 to verify R1's loopback (1.1.1.1/32) appears with next-hop 10.0.12.1
Configuration
! On R1
interface GigabitEthernet0/0
 ip address 10.0.12.1 255.255.255.252
 no shutdown
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
router ospf 1
 network 10.0.12.0 0.0.0.3 area 0
 network 1.1.1.1 0.0.0.0 area 0
!
! On R2
interface GigabitEthernet0/0
 ip address 10.0.12.2 255.255.255.252
 no shutdown
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
router ospf 1
 network 10.0.12.0 0.0.0.3 area 0
 network 2.2.2.2 0.0.0.0 area 0

Verify: On R1: show ip route ospf Expected output includes: O 2.2.2.2 [110/2] via 10.0.12.2, 00:00:10, GigabitEthernet0/0

Watch out: If the route does not appear, check OSPF adjacency with 'show ip ospf neighbor'. Common mistake: forgetting to advertise the loopback interface in OSPF.

Troubleshoot Missing Default Route via Static Route

A branch router needs a default route pointing to the corporate headquarters. After configuring a static default route, you must verify it appears in the routing table and is used for outbound traffic.

Topology

Branch(Gi0/0)---192.168.1.0/30---(Gi0/0)HQ Branch LAN: 10.10.10.0/24

Steps

  1. 1.Step 1: Enter privileged EXEC mode on Branch: enable
  2. 2.Step 2: Display the routing table: show ip route
  3. 3.Step 3: Look for a line starting with 'S*' indicating a static default route (0.0.0.0/0)
  4. 4.Step 4: Verify the next-hop IP is the HQ router's interface (192.168.1.2)
Configuration
! On Branch
ip route 0.0.0.0 0.0.0.0 192.168.1.2
! On HQ (for return traffic)
ip route 10.10.10.0 255.255.255.0 192.168.1.1

Verify: On Branch: show ip route Expected output includes: S* 0.0.0.0/0 [1/0] via 192.168.1.2

Watch out: If the default route does not appear, ensure the next-hop IP is reachable (directly connected). Common mistake: using an incorrect next-hop IP or forgetting to configure a return route on HQ.

Troubleshooting with This Command

When troubleshooting connectivity issues, 'show ip route' is often the first command to run. A healthy routing table shows routes with appropriate sources (C for connected, S for static, O for OSPF, D for EIGRP, etc.) and valid next-hop IPs that are reachable. Problem indicators include missing routes, routes with unexpected administrative distances or metrics, or routes pointing to unreachable next-hops.

For example, if a route shows 'via 10.0.0.1' but that next-hop is not directly connected, the route is invalid and will not be used. Focus on the route source code: 'O' for OSPF, 'D' for EIGRP, 'S' for static, 'C' for connected. A missing route for a known network suggests a routing protocol issue or misconfiguration.

Common symptoms: 'Destination unreachable' from ping often correlates with no route in the table. Step-by-step diagnostic flow: 1) Identify the destination IP. 2) Run 'show ip route <destination>' to see if a route exists. 3) If no route, check routing protocol status with 'show ip protocols' and 'show ip ospf neighbor' or 'show ip eigrp neighbors'. 4) If a route exists but ping fails, check the next-hop reachability with 'show ip arp' or 'ping <next-hop>'. 5) If the route is present but has a high metric or administrative distance, compare with other routes to ensure the best path is selected. Correlate with 'show ip interface brief' to verify interface status, and 'debug ip routing' to see real-time route changes.

For example, if OSPF routes are missing, 'show ip ospf interface' can reveal if the interface is in the correct area. In summary, 'show ip route' is the starting point for most Layer 3 troubleshooting, and its output guides further investigation.

CCNA Exam Tips

1.

CCNA exam: administrative distances to memorise — connected=0, static=1, EIGRP=90, OSPF=110, RIP=120, external EIGRP=170, unknown=255. [110/2] means OSPF (AD 110) with metric 2

2.

A route with AD 255 is never used

3.

If two routes exist for the same prefix, IOS installs the one with lower AD

4.

Equal-cost routes (same AD+metric) are load-balanced

Common Mistakes

Confusing administrative distance (trustworthiness) with metric (cost within protocol)

Not having a default route and wondering why internet traffic fails — check 'Gateway of last resort is not set'

Forgetting that L routes (local) are /32 entries for the interface's own IP, not host routes to other devices

show ip route vs show ip ospf neighbor

While both commands are used in routing troubleshooting, 'show ip route' displays the global routing table with all known routes, whereas 'show ip ospf neighbor' focuses specifically on OSPF adjacency states. They are often considered together because OSPF neighbor status directly influences the OSPF routes that appear in the routing table.

Aspectshow ip routeshow ip ospf neighbor
ScopeGlobal routing table (all protocols)OSPF-specific neighbors only
Information DisplayedRoutes, next-hops, interfaces, AD, metricNeighbor IDs, state, dead timer, interface
Primary UseTroubleshoot end-to-end reachabilityVerify OSPF neighbor formation and stability
Protocol DependencyWorks regardless of routing protocolOnly relevant when OSPF is configured
Output FormatTable of prefixes with attributesList of neighbors with state and timers
Dependency on OSPFShows OSPF-learned routes if presentShows OSPF neighbors, not routes

Use 'show ip route' when you need to verify the actual forwarding table or check whether a specific destination is reachable and via which next-hop.

Use 'show ip ospf neighbor' when you suspect OSPF adjacency issues or need to confirm that a neighbor router is fully adjacent before expecting OSPF routes to appear.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the 'show ip route' command syntax and output are largely identical to classic IOS. However, IOS-XE may include additional fields like 'U' for unreachable or 'N' for NAT routes. The command is available in all privilege levels (user EXEC shows a limited view, but full output requires enable).

In NX-OS (e.g., Nexus switches), the equivalent command is 'show ip route' as well, but the output format differs: it uses a more structured, table-like format and includes VRF information by default. For example, 'show ip route vrf default' is common. NX-OS also supports 'show ip route summary' for a concise view.

On ASA firewalls, the command is 'show route' (not 'show ip route'), and it displays the routing table for all contexts. The ASA output includes protocol codes like 'C', 'S', 'O', 'R', 'B', and 'D' but also 'L' for local routes. In IOS-XR (e.g., ASR 9000), the command is 'show route' (not 'show ip route'), and it uses a different syntax: 'show route ipv4 unicast' is typical.

IOS-XR output is more verbose and includes RIB (Routing Information Base) details. Between IOS versions, the basic output has remained consistent from 12.x to 15.x and 16.x, but newer versions may add fields like 'N' for NAT or 'H' for DHCP. Always check the specific platform documentation for exact syntax variations.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions