Routing questions become easier when you separate three decisions that happen at different times.
Keep route learning, installation, and forwarding separate
- A route source selects its preferred path using its own rules and metric.
- The router decides which competing route source to install for the same destination prefix.
- The forwarding process chooses the longest matching installed prefix for the packet's destination.
Administrative distance and metrics help decide what enters the routing table. Longest-prefix match decides which installed route forwards one packet.
Read each routing-table field as evidence
R1# show ip route
O 10.40.0.0/16 [110/20] via 192.0.2.6, GigabitEthernet0/0
S 10.40.8.0/24 [1/0] via 198.51.100.2
S* 0.0.0.0/0 [1/0] via 192.0.2.2
| Field | What it tells you |
|---|---|
| Route code | Where the route came from, such as connected, static, or OSPF. |
| Prefix and mask | Which destination addresses the route can match. |
| Administrative distance | Which route source is preferred for the same destination prefix. |
| Metric | Which path one routing protocol prefers among its candidates. |
| Next hop | Which neighboring address receives the packet next. |
| Exit interface | Which local interface sends the packet. |
* | A candidate default route in common IOS output. |
Use the correct route-selection order
For forwarding one packet:
- Identify the exact destination address.
- Find installed routes whose prefixes contain that address.
- Choose the longest matching prefix.
- Read the next hop or exit interface.
- Confirm the next hop can be resolved and reached.
- Confirm the destination has a return path.
For routes competing to enter the table for the same prefix:
- A routing protocol uses its metric to choose its own best path.
- If different route sources offer the same prefix, the lower administrative distance is preferred.
- Equal-cost paths from the selected source may be installed when the platform and protocol allow it.
A /24 route can forward a packet instead of a /16 route even when the /16 came from a source with a lower administrative distance. The prefixes are different, so both may be installed. Longest-prefix match then chooses the /24 for destinations inside it.
Recognize the purpose of each static route
| Type | IPv4 example | Purpose |
|---|---|---|
| Network route | 10.30.0.0/24 | Matches a range of destination addresses. |
| Host route | 10.30.0.25/32 | Matches one destination address. |
| Default route | 0.0.0.0/0 | Matches when no more-specific route is available. |
| Floating static | Static route with a higher AD | Waits as a backup while a preferred route remains installed. |
ip route 10.30.0.0 255.255.255.0 192.0.2.2
ip route 10.30.0.25 255.255.255.255 192.0.2.2
ip route 0.0.0.0 0.0.0.0 192.0.2.2
ip route 10.30.0.0 255.255.255.0 198.51.100.2 200
The last route uses administrative distance 200, so it can remain out of the table while a lower-AD route to the same prefix is healthy.
Next hop, exit interface, and fully specified routes
A static route may name:
- A next-hop address, which the router resolves through another route.
- An exit interface, which tells the router where to send traffic.
- Both, creating a fully specified route.
On point-to-point links, an exit-interface route is often clear because only one neighbor exists. On multi-access Ethernet, a next hop or fully specified route gives clearer neighbor-resolution behavior.
The best syntax depends on the interface type and design. The exam clue is usually whether the router can resolve a usable forwarding path.
Apply the same logic to IPv6 static routes
ipv6 route 2001:db8:30::/64 2001:db8:12::2
ipv6 route 2001:db8:30::25/128 2001:db8:12::2
ipv6 route ::/0 2001:db8:12::2
A link-local next hop needs the outgoing interface because link-local addresses have meaning only on one link:
ipv6 route 2001:db8:30::/64 GigabitEthernet0/0/1 FE80::2
A configured route is not automatically usable
If a static route appears in the running configuration but not in the routing table, check:
- Is the exit interface up?
- Can the next-hop address be reached through an installed route?
- Is the destination prefix and mask correct?
- Is a tracking condition preventing installation?
- Is this a floating route whose preferred route is still present?
- For an IPv6 link-local next hop, was the outgoing interface included?
If the route is installed but traffic still fails, check neighbor resolution, access controls, downstream routing, and the return path.
Choose IOS evidence that answers the next question
| Question | Useful command |
|---|---|
| Which routes are installed? | show ip route or show ipv6 route |
| Which route matches one destination? | show ip route address or show ipv6 route address |
| Which static routes are configured? | show running-config | include ^ip route |
| Is the exit interface usable? | show ip interface brief or show ipv6 interface brief |
| Can the router reach the next hop? | ping, extended ping, ARP, or IPv6 neighbor output |
| Where does routed forwarding stop? | traceroute |
Scenario comparisons
A /24 static route and /16 OSPF route both match
Use the /24 for a destination inside that prefix. Longest-prefix match is more specific than the /16.
A floating route is configured but absent from the table
Check whether the preferred route still exists. A healthy primary route is a valid reason for the floating route to remain inactive.
The outbound path works but replies never return
Check the destination's route back to the source, stateful firewall behavior, and address translation where present. Routing is a round-trip problem.
A route names a next hop that is not reachable
The configuration line alone is not enough. Add or repair the route that resolves the next hop, or correct the intended forwarding path.
Common exam traps
- Treating administrative distance as longest-prefix match.
- Comparing metrics from unrelated routing protocols.
- Assuming the smallest number anywhere in the table always wins.
- Assuming a configured static route must be installed.
- Replacing a floating route because it is correctly inactive.
- Forgetting the return path.
- Using a link-local IPv6 next hop without interface context.
- Reading a successful ping as proof that the complete design is correct.
Rapid review grid
| Decision | Rule |
|---|---|
| Forward one packet | Use the longest matching installed prefix. |
| Choose between route sources for the same prefix | Prefer the lower administrative distance. |
| Choose among paths from one routing protocol | Use that protocol's metric. |
| Match one IPv4 host | Use a `/32` host route. |
| Match one IPv6 host | Use a `/128` host route. |
| Provide a backup route | Use a floating static route with a higher AD. |
| Use an IPv6 link-local next hop | Include the outgoing interface. |