Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Routing Table

Direct answer

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.

When to use this

Use it to see where traffic for a destination will go, and why.

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · Cisco IOS XE · IOS/IOS XE
Key commandshow ip route
Scope / prerequisiteUse it to see where traffic for a destination will go, and why.
Show · 3Reference · 1
What next?3 suggested next steps
Child topics (this level)13
Catalog command links4
Evidence0
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show ip route

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.

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.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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.

Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Connected

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 Local

A 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 Static

A 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 OSPF

OSPF 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 EIGRP

An 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 BGP

A 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 Prefix

A 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 length

The prefix length (/n) is the number of leading network bits in an address or route.

Subtopic Next hop

A 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 interface

The outgoing interface is the local egress selected after route lookup and any required recursive next-hop resolution.

Subtopic Administrative Distance

Administrative 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 Metric

A 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 Resort

On Cisco IPv4 routing, “Gateway of last resort” summarizes the currently selected default-routing behavior.

Key points

Read each line: O 10.2.0.0/16 [110/20] via 10.0.0.2, 00:12:03, Gi0/1 — learned by OSPF, distance 110, metric 20, next hop, age, interface. C connected, L local (the router's own address), S static, S* default, O OSPF, D EIGRP, B BGP. Without a default route, unknown destinations are dropped.

Key checks
  • 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.

SourceDistance
Connected0
Static1
eBGP20
EIGRP90
OSPF110
IS-IS115
RIP120
EIGRP external170
iBGP200

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
PartMeaning
O IASource code: OSPF inter-area
10.30.0.0/16Prefix and length
[110/12]Administrative distance / metric
via 10.0.12.2Next hop
00:41:02Age of the route
GigabitEthernet0/0/1Outgoing interface

Route codes

CodeSource
C / LConnected subnet / local address
S / S*Static / static default
O, O IA, O E1/E2OSPF intra-area, inter-area, external
D, D EXEIGRP internal, external
BBGP
iIS-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

StepRule
A source offers a routeConnected, static, protocol
Same prefix and length from several sourcesLowest distance wins
Several paths from one protocolBest 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

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%
Embedded reference data

Quick lookup tables

Routing Table · reference boundaries

Compact technical reference for the most important state and interpretation boundaries.

DecisionApplied whenKey fact
Longest-prefix matchForwarding toward a destinationMost specific installed prefix wins
Administrative distanceSame prefix from different route sourcesLower distance is preferred
Protocol metricMultiple candidates inside a routing processProtocol-specific best path
RecursionRoute points to a next-hop addressNext hop must resolve to usable adjacency
Confirmation

Confirm action

Continue?