Use it to see where traffic for a destination will go, and why.
Routing Table
The routing table lists every network the router knows: the prefix, how it was learned (code letter), administrative distance and metric in brackets, the next hop and the outgoing interface.
1. show ip route <dst> — the route and how it was learned.
2. Gateway of last resort is not set and no specific route → dropped.
3. Unexpected source → compare administrative distances.
4. Age very young or changing → the route is flapping; check the protocol neighbour.
5. Next hop unreachable → the route is useless.
routes learned from connected, static and protocols → best per prefix installed with code, AD/metric, next hop and interface → default route as last resort
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip routeShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show ip routeShowIPv4 RIB routes and selected next hops.
Use when: Use at the Network Troubleshooting, Ping, Traceroute and Debugging boundary after prerequisite state is verified.
Quick note: Operational guidance. One successful probe does not prove all sources, packet sizes, protocols, directions or times are healthy.
Cisco IOS XE · mixedshow ip route <prefix>ReferenceDisplay the route the router uses for a destination or prefix.
Use when: Inspect the exact installed route and next-hop decision.
Quick note: This output proves only its local evidence boundary; continue to the next layer.
Cisco IOS / IOS XE · mixedshow ipv6 routeShowDisplay the IPv6 routing table.
Use when: Use at the Network Troubleshooting, Ping, Traceroute and Debugging boundary after prerequisite state is verified.
Quick note: Operational guidance. One successful probe does not prove all sources, packet sizes, protocols, directions or times are healthy.
Cisco IOS / IOS XE · mixedshow ip protocolsShowDisplay active routing protocol parameters.
Use when: Routing protocol sanity check.
Quick note: Useful companion to route and neighbor tables.
IOS/IOS XE · mixedHow to read the output
show ip routeLook first: route source/code, prefix, next hop, outgoing interface
Healthy: Expected prefix is installed with intended next hop/source.
Warning: Route absent, unexpected protocol/AD/metric, recursive next hop or wrong exit.
Does not prove: RIB presence does not prove FIB programming or packet delivery.
show ip route <prefix>Look first: route source/code, prefix, next hop, outgoing interface
Healthy: Expected prefix is installed with intended next hop/source.
Warning: Route absent, unexpected protocol/AD/metric, recursive next hop or wrong exit.
Does not prove: RIB presence does not prove FIB programming or packet delivery.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Looking up a destination Verify boundary
show ip route
show ip route 10.20.0.50
show ip route 10.20.0.0 255.255.255.0 longer-prefixes
show ip cef 10.20.0.50
show ip route <address> is the key command: it shows the one entry that matches that address by longest prefix, with its source, distance, metric and next hops. longer-prefixes lists all more specific routes inside a range. CEF shows the resolved next hop and interface actually used.
Always look up the destination address, not the network you expect it to be in — the matching entry may be a different one.
Known-good: the address matches the intended entry, from the intended source, with a next hop that is reachable.
Step 2 Verification and output interpretation Verify boundary
Use show ip route <destination> or the closest exact lookup available instead of visually scanning the whole table. Confirm the winning prefix length, route source, administrative distance/metric, next hop and outgoing interface. If the next hop is recursive, follow the recursion until it resolves to a connected adjacency. Then compare with show ip cef <destination> when forwarding-programming state matters. For equal-cost routes, note that multiple next hops can be legitimate and the selected path for one flow may depend on CEF load sharing rather than a single static choice.
Subtopics
Go one level deeper into this subject.
A connected route represents an IP prefix directly attached to a router interface; it is installed when the interface and configured address/prefix are operationally usable.
Subtopic LocalA local route is a host route for an address owned by the router itself, commonly shown as /32 in IPv4 or /128 in IPv6, and distinguishes traffic destined to the control-plane endpoint from traffic merely on a connected subnet.
Subtopic StaticA static route is an administratively configured route to a destination prefix through a next hop, exit interface or both; installation still depends on recursive reachability, interface state and routing-table scope.
Subtopic OSPFOSPF routes in the routing table are selected products of the OSPF control plane; a healthy adjacency and LSDB do not guarantee a specific OSPF prefix wins the RIB against other sources.
Subtopic EIGRPAn EIGRP-derived route in the IPv4 routing table is the result of EIGRP topology computation plus RIB selection, not merely proof that an EIGRP neighbor exists.
Subtopic BGPA BGP route must pass several boundaries before it forwards traffic: the path is learned into the BGP table, selected as best, offered to the global/VRF RIB, wins against competing routing sources, and has a resolvable next hop for FIB programming.
Subtopic PrefixA routing prefix identifies a destination address range and prefix length; routers select the most-specific matching prefix before protocol preference and metric decide among competing routes to that same prefix.
Subtopic Prefix lengthThe prefix length (/n) is the number of leading network bits in an address or route.
Subtopic Next hopA routing-table next hop is the intermediate address used to continue forwarding toward a destination; it must recursively resolve to a connected/outgoing path and usable adjacency before packets can leave successfully.
Subtopic Outgoing interfaceThe outgoing interface is the local egress selected after route lookup and any required recursive next-hop resolution.
Subtopic Administrative DistanceAdministrative Distance is a local route-source preference used to choose between candidate routes to the same prefix learned from different sources; it is not a path metric and is not advertised end-to-end.
Subtopic MetricA routing metric represents path preference within a routing protocol or route source; its meaning is protocol-specific, so numeric metrics from OSPF, EIGRP and BGP cannot be compared as a universal distance.
Subtopic Gateway of Last ResortOn Cisco IPv4 routing, “Gateway of last resort” summarizes the currently selected default-routing behavior.
show ip route— the full table.show ip route <dst>— the route chosen for one address, with details.show ip route summary— routes per source.show ip route | include ^S|^O— routes of one kind.show ipv6 route— the IPv6 table.
ReferenceHow it works1 section · depth on demand
How the routing table chooses a route
Three decisions, in this order of events.
1. Within a routing protocol: metric. OSPF, EIGRP and BGP may each know several paths to a network. Each picks its best by its own measure and offers only that one to the routing table.
2. Between sources, for the same prefix: administrative distance. If two sources offer the same network with the same prefix length, the one with the lower administrative distance is installed.
| Source | Distance |
|---|---|
| Connected | 0 |
| Static | 1 |
| eBGP | 20 |
| EIGRP | 90 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| EIGRP external | 170 |
| iBGP | 200 |
3. When forwarding a packet: longest prefix match. Of all installed routes that contain the destination address, the one with the longest prefix is used. A /28 beats a /24, which beats a default route — regardless of distance or metric.
The third rule is applied to every packet and outranks the others in effect: routes with different prefix lengths are different entries and never compete on distance. A static /24 does not suppress an OSPF /25 inside it.
Reading an entry.
O 10.20.0.0/24 [110/20] via 10.0.12.2, 00:12:44, GigabitEthernet0/0
Source code (O = OSPF), network, [administrative distance/metric], next hop, age and outgoing interface. Common codes: C connected, L the router's own address, S static, D EIGRP, B BGP, and * marking a candidate default route.
Recursion. If a route names only a next hop, the router looks that address up in turn until it reaches a connected network. A route whose next hop cannot be resolved is not installed.
Several routes to the same prefix from the same source with equal metric are installed together and share the traffic.
ReferenceImportant terms & boundaries3 sections · depth on demand
In depth
The routing table
The routing table (RIB) lists every route the router uses, with its source, distance, metric, next hop and outgoing interface. Cisco's IOS XE routing guide lists the views for inspecting it: show ip route by address and mask (with longer-prefixes), by protocol, show ip route summary, and show ip route supernets-only, with clear ip route to remove entries when the table is suspect.
Reading an entry
O IA 10.30.0.0/16 [110/12] via 10.0.12.2, 00:41:02, GigabitEthernet0/0/1
| Part | Meaning |
|---|---|
O IA | Source code: OSPF inter-area |
10.30.0.0/16 | Prefix and length |
[110/12] | Administrative distance / metric |
via 10.0.12.2 | Next hop |
00:41:02 | Age of the route |
GigabitEthernet0/0/1 | Outgoing interface |
Route codes
| Code | Source |
|---|---|
| C / L | Connected subnet / local address |
| S / S* | Static / static default |
| O, O IA, O E1/E2 | OSPF intra-area, inter-area, external |
| D, D EX | EIGRP internal, external |
| B | BGP |
| i | IS-IS |
R1# show ip route
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, 12 subnets, 4 masks
C 10.0.12.0/30 is directly connected, GigabitEthernet0/0/1
L 10.0.12.1/32 is directly connected, GigabitEthernet0/0/1
O 10.20.0.0/24 [110/2] via 10.0.12.2, 00:41:02, GigabitEthernet0/0/1
O IA 10.30.0.0/16 [110/12] via 10.0.12.2, 00:41:02, GigabitEthernet0/0/1
R1# show ip route 10.30.0.15
R1# show ip route 10.0.0.0 255.0.0.0 longer-prefixes
How routes get in
| Step | Rule |
|---|---|
| A source offers a route | Connected, static, protocol |
| Same prefix and length from several sources | Lowest distance wins |
| Several paths from one protocol | Best metric; equal paths installed together (four by default for most protocols, per the guide) |
What the table doesn't show
Protocol databases (OSPF LSDB, EIGRP topology, BGP table) hold alternatives that lost; check them when an expected route is missing from the RIB.
Documented example, not captured output.
Concept and state model
Routing is prefix based. For a destination address, the most specific matching prefix wins regardless of whether a less-specific route has a “better” administrative distance or metric. Administrative distance is used when different route sources compete to install the same destination prefix/prefix length, while protocol metrics determine the preferred path according to the protocol’s own rules. A selected route can reference a directly connected interface, a next-hop address or a recursive next hop that itself requires another route. The RIB is therefore both a decision result and a dependency graph. The forwarding plane derives FIB/CEF state from selected routes and resolved adjacencies, so a RIB entry is necessary but not always sufficient for data-plane success.
Operational boundaries and common misconceptions
Route presence does not show neighbor resolution, CEF programming, return routing, security policy or application health. Absence from the RIB also does not show that a routing protocol never learned the route: it may exist in protocol-specific state but lose selection to another source. Administrative distance is not part of packet forwarding and is not compared between different prefix lengths. Metrics from different routing protocols are not directly comparable. Always separate route learning, RIB selection, next-hop resolution and FIB forwarding when interpreting routing state.
ReferenceConfiguration & state1 section · depth on demand
Configuration model and design choices
Route sources should be intentional: connected networks come from interface addressing, static routes represent explicit operator policy, and dynamic protocols contribute learned candidates. Avoid using administrative distance or metrics as arbitrary “priority numbers” without understanding which prefixes and route sources actually compete. Floating statics are useful when their higher distance makes them true backups to a preferred route source, but they still require a usable next-hop path. Route summarization and default routes reduce table size and policy complexity, but they also hide more-specific topology information and therefore need explicit discard/reachability semantics where appropriate.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Routing → Routing Table. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%Quick lookup tables
Routing Table · reference boundaries
Compact technical reference for the most important state and interpretation boundaries.
| Decision | Applied when | Key fact |
|---|---|---|
| Longest-prefix match | Forwarding toward a destination | Most specific installed prefix wins |
| Administrative distance | Same prefix from different route sources | Lower distance is preferred |
| Protocol metric | Multiple candidates inside a routing process | Protocol-specific best path |
| Recursion | Route points to a next-hop address | Next hop must resolve to usable adjacency |