Use the Cisco command prompt to view and manage the routing table on any Cisco router or switch running IOS or IOS XE. The show ip route command and related utilities let you inspect active routes, verify next hops, and troubleshoot reachability issues quickly.
These commands provide a direct view of the IP routing table, helping you confirm policy application, validate redistribution, and maintain stable network paths. Mastering the Cisco command prompt for routing table analysis is essential for reliable operations and fast troubleshooting.
| Command | Purpose | Key Output Fields | Use Case |
|---|---|---|---|
| show ip route | Display the full IP routing table | Codes, Network, Mask, Next Hop, Interface | Verify reachability and route sources |
| show ip route static | Show only static routes | Network, Mask, Next Hop, Administrative Distance | Validate static configuration |
| show ip route ospf | Show OSPF-learned routes | Network, Mask, Cost, Forwarding Address | Troubleshoot OSPF adjacencies and route injection |
| show ip route [prefix] | Filter for a specific prefix | Mask, Next Hop, Metric, Route Source | Confirm specific end-to-end paths |
View Routing Table from the Cisco Command Prompt
At the Cisco command prompt, the show ip route command is the primary tool for inspecting the routing table. It lists known networks, associated metrics, and the next hop or exit interface.
Each line includes a route code indicating the source, such as C for connected, S for static, O for OSPF, and R for RIP. Understanding these codes helps you quickly identify how each route was learned and whether it is actively used.
Filter Output to Focus on Specific Protocols
You can limit the output to routes learned from a single routing protocol to reduce noise and focus your analysis. This approach is useful after changes to redistribution or when validating a single-protocol peer relationship.
Filter by Protocol Examples
- show ip route ospf
- show ip route eigrp
- show ip route rip
- show ip route static
Verify Next Hop and Exit Interface Details
For every route, the Cisco command prompt shows the next-hop IP address and the outgoing interface, which are critical for traffic engineering and verifying load balancing. You can also see whether the route points to a directly reachable next hop or requires an additional level of recursion.
When a route points to an interface rather than a next-hop IP, the router will use the Layer 2 destination corresponding to that prefix when forwarding packets. This distinction affects configuration choices such as frame-relay maps or NHRP mappings in hub-and-spoke designs.
Diagnose and Resolve Common Routing Issues
Use the Cisco command prompt to compare the routing table against expected policy rules, BGP communities, or route-map manipulations. Missing or suboptimal routes often trace back to distribute-list filters, prefix-length mismatches, or asymmetric administrative distances.
Key Takeaways for Managing Routing Tables at the Command Prompt
- Use show ip route to review the entire IP routing table and confirm route sources.
- Apply protocol-specific filters such as show ip route ospf or show ip route static for focused analysis.
- Check next-hop IPs and exit interfaces to validate recursion and reachability.
- Monitor administrative distances and distribute-list filters when troubleshooting missing or suboptimal routes.
- Verify that reachable next hops and correct outgoing interfaces prevent connectivity issues.
FAQ
Reader questions
How do I display the current IP routing table on a Cisco router?
Enter enable mode and then type show ip route at the command prompt to display the current IP routing table with all sources and next hops.
What does the code O indicate in the routing table output?
The code O indicates an OSPF-learned route, including the network, mask, cost, and optional forwarding address fields.
How can I view only static routes in the routing table?
Use the command show ip route static to filter and display only static routes and their administrative distance.
Why do some prefixes show as directly connected even after I add a static route?
A directly connected route can override a static route if the static next hop is not reachable on the same subnet or the outgoing interface is down, so verify next-hop reachability and interface status.