5 Integrated Routing Practice
Learn how hosts and routers select routes, how OSPF and static routes interact, and how to troubleshoot first-hop redundancy and complete forward and return paths.
How a packet follows a path
A routing table contains destinations and forwarding instructions; it does not describe one guaranteed end-to-end path. Each router makes its own decision for each packet, so a successful forward path does not by itself ensure that replies can return.
Analyze the path one hop at a time
Work through each packet hop by hop:
Check the destination subnet. A host sends directly to another host on its own subnet. If the destination is outside that subnet, the host sends the packet to its default gateway.
Choose the gateway. With first-hop redundancy, the configured gateway can be a shared virtual IP address rather than either router’s physical IP address.
Select a route. At each router, find the installed route that matches the destination. The is the most-specific match and determines forwarding.
Resolve the next hop. Confirm that the next-hop address can be reached through an active interface or another valid route.
Repeat at every router. Each router along the path needs a usable route onward. The destination-side router also needs a route back to the source network for replies.
Troubleshoot one destination at a time: inspect the selected route on each router, test next-hop reachability, trace the path, and then test the return direction.
Route selection and preference
Routes can come from connected interfaces, static configuration, and routing protocols such as . They enter the according to route-source preference and the protocol’s own selection rules. When forwarding a packet, the router uses the installed route with the .
compares competing route sources for the same prefix and prefix length. On Cisco IOS, common default administrative distances are 1 for static routes and 110 for . does not make a less-specific route beat a more-specific route: prefix length determines the forwarding match after routes are installed.
Within , the protocol selects paths using its cost metric, based on the link-state topology. Equal-cost paths may both be used, depending on the implementation and configuration.
Follow an route
In this simplified network, Host A has address 10.1.10.25/24, R1 has LAN address 10.1.10.1, the router-to-router next hop is 10.0.12.2, and the server is 10.2.20.50/24 on 10.2.20.0/24.
Assume R1 learns 10.2.20.0/24 through with next hop 10.0.12.2, and Host A uses 10.1.10.1 as its gateway. Because the server is outside Host A’s 10.1.10.0/24 subnet, Host A sends the packet to R1. R1 matches the route and forwards the packet to R2; R2 has the server network directly connected and delivers the packet.
For a reply to succeed, R2 also needs a route to 10.1.10.0/24. commonly supplies that route if the LAN is included in the process and advertised as intended. An neighbor being present does not by itself prove that the required prefix is in the routing table.
Useful Cisco IOS checks include:
show ip route 10.2.20.50 helps identify the selected route for that particular destination. routers use link-state information to calculate shortest paths and populate routes.
Use static routes as backups
A can back up a preferred dynamic route. It is configured with a higher than the preferred route and may be installed if that route disappears. The backup is useful only if its next hop remains reachable and the rest of the path works.
Suppose R1’s primary path toward 10.2.20.0/24 uses 10.0.12.2, and a backup path uses 10.0.13.2. This Cisco IOS-style route gives the static route an of 200, higher than ’s common default of 110:
If the matching route is removed, the static route may become installed, provided its next hop remains reachable. If R1 also has a static route for 10.2.0.0/16, a packet to 10.2.20.50 still uses the more-specific 10.2.20.0/24 match. does not override longest-prefix forwarding.
Check the route and next-hop reachability when testing failover:
A static route to a next-hop address that cannot be resolved is not a dependable backup. Static-route behavior and syntax can vary across platforms and software versions, so confirm commands for the device in use.
Provide a redundant default gateway
Two routers can connect to the same user LAN and provide one virtual gateway address:
The host is configured with 10.1.10.1 as its default gateway. elects an active router to forward traffic for that virtual address and a standby router to take over if the active router fails. During a normal failover, the host continues using the same gateway address; it does not need to change its default gateway to the new active router’s physical IP.
These Cisco IOS-style LAN-interface configurations give R1 the higher priority. With preemption enabled and the group operating normally, R1 is intended to become active.
protects the first hop on the LAN; it does not automatically guarantee a working route beyond that LAN. If R1’s LAN interface stays up while its upstream path fails, R1 could remain active unless the configuration detects the upstream failure and reduces its priority, or another mechanism selects a usable gateway. Test failures relevant to the design, not only a router power-off. Check the platform command reference for exact syntax and behavior.
Useful checks include:
Diagnose the complete path
Use this topology to organize a client-to-server diagnosis:
Work through the questions in order:
Does Host A consider the server address local or remote? If remote, is its default gateway the virtual IP on LAN A?
Which router is active, and can that router forward beyond LAN A?
On the active router, which route matches the server destination? Is it connected, static, or learned by ?
If multiple routes have the same prefix, which route source wins? If the matching prefixes differ in length, which is the longest match?
Does each next hop resolve, and does the next router have a route onward?
Does the destination-side router have a route back to Host A’s subnet?
If the primary path fails, should reconverge, should a take over, or should fail over? Do the configured routes and tracking behavior actually cover that failure?
Inspect the selected route and next-hop reachability on each router, trace the path, and test the return direction. This helps distinguish a missing route from an election issue or a failed link.