Pcornel
Networking · Routing

Routing Table

Cheat sheet · https://pcornel.dk/topic.php?topic=621

Back to the Topic

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.

Remember

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.

First 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.

Commands

show ip route
IPv4 RIB routes and selected next hops.
show ip protocols
Display active routing protocol parameters.
show ipv6 route
Display the IPv6 routing table.
show ip route <prefix>
Display the route the router uses for a destination or prefix.
show ip route <address>
show ip route summary
show ip route supernets-only
clear ip route
show ip route <destination>
show ip cef <destination>

Verify in this order

routes learned from connected, static and protocols → best per prefix installed with code, AD/metric, next hop and interface → default route as last resort

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

Routing Table · reference 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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=621

Confirmation

Confirm action

Continue?