This page is for study. Please confirm important details against the original standards and vendor documents.
Study reference
Routing Cheat Sheet
How routers choose routes, administrative distance, static routes and how to read the routing table.
1. How a router chooses a route
- Longest prefix match first. The most specific matching route wins (a /26 beats a /24 beats 0.0.0.0/0).
- Lowest administrative distance (AD) decides between routes to the same prefix from different sources.
- Lowest metric decides between routes from the same routing protocol.
- If routes tie, the router may load-balance across them (equal-cost paths).
2. Default administrative distance (Cisco)
| Route source | Default AD |
|---|---|
| Connected interface | 0 |
| Static route | 1 |
| EIGRP summary route | 5 |
| External BGP (eBGP) | 20 |
| EIGRP (internal) | 90 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| EIGRP (external) | 170 |
| Internal BGP (iBGP) | 200 |
| Unknown or unreachable | 255 (not used) |
A lower number is more trusted. A floating static route is a static route given a higher AD than the dynamic protocol (for example 150), so it is used only when the dynamic route disappears.
3. Routing protocol families
| Protocol | Type | Metric | Notes |
|---|---|---|---|
| RIP (v2) | Distance vector | Hop count (15 max, 16 = unreachable) | UDP port 520. Simple, slow to converge. Small labs only. |
| EIGRP | Advanced distance vector (DUAL) | Composite; bandwidth and delay by default | Cisco-developed; informational RFC 7868. Multicast 224.0.0.10. |
| OSPF | Link state | Cost (based on bandwidth) | Open standard, areas, IP protocol 89. See the OSPF sheet. |
| IS-IS | Link state | Metric per link | Common in service-provider networks. |
| BGP | Path vector | Path attributes (not a single metric) | Between organisations, TCP port 179. See the BGP sheet. |
IGP = routing inside one organisation (RIP, EIGRP, OSPF, IS-IS). EGP = routing between organisations (BGP today).
4. Static routes
! Route to a remote network through a next-hop address
ip route 10.2.0.0 255.255.0.0 192.168.1.2
! Default route (everything else)
ip route 0.0.0.0 0.0.0.0 192.168.1.1
! Floating static route: backup, used only if AD 110 route is lost
ip route 10.2.0.0 255.255.0.0 192.168.2.2 150
! A multilayer switch must have routing switched on
ip routing
5. Reading show ip route
Codes: C - connected, L - local, S - static, R - RIP, D - EIGRP,
O - OSPF, B - BGP, * - candidate default
O 10.2.0.0/16 [110/20] via 192.168.1.2, 00:05:12, GigabitEthernet0/1
^ ^
| metric
administrative distance Useful variations: show ip route 10.2.0.5 (the route used for one address), show ip route ospf, show ip route static, show ip protocols.
6. When a route is missing: check in this order
- Is the interface up/up and does it have the right address and mask? (
show ip interface brief) - Does the router have a route to the destination, and is it the one you expect? (
show ip route <address>) - Is the next hop reachable? (
pingthe next hop first) - For dynamic routing: is the neighbour up and are the networks advertised? (
show ip protocols, the protocol's neighbour command) - Is an access list, firewall or NAT rule blocking the traffic? Does the return path exist too?
More cheat sheets
- Networking Cheat Sheet
- OSPF Cheat Sheet
- BGP Cheat Sheet
- SDN, SD-WAN and SASE Cheat Sheet
- Cisco Commands Cheat Sheet