Static and default routes
A three-network topology
A static route tells a router how to reach a prefix that is not directly connected. In the paper lab below A uses gateway 192.0.2.1 and B uses 203.0.113.1. R1 and R2 share a transit subnet. Assume all links are up, addresses are correct, forwarding is enabled and no policy blocks traffic. These documentation ranges are fictional; do not deploy them on a public network.
A 192.0.2.10/24 -- R1 LAN 192.0.2.1/24R1 198.51.100.1/30 -- R2 198.51.100.2/30R2 LAN 203.0.113.1/24 -- B 203.0.113.10/24Build forward and return routes
R1 already knows its LAN and the transit link; R2 knows its LAN and transit link. To reach B, R1 needs a route to 203.0.113.0/24 through 198.51.100.2. To reach A, R2 needs a route to 192.0.2.0/24 through 198.51.100.1. A sends to its local gateway, R1 forwards to R2, and R2 forwards directly to B. The reply independently follows B–R2–R1–A. If the return route is absent and no other matching route exists, the request may arrive but the reply cannot return.
R1: 203.0.113.0/24 via 198.51.100.2R2: 192.0.2.0/24 via 198.51.100.1Read platform-specific syntax
The following are static illustrations, not commands to run on your computer. Linux iproute2 uses a prefix and via; Cisco IOS XE 17.x IPv4 global configuration uses a destination and dotted mask, then next hop. Each line describes the same R1 intent on a different platform. Interfaces and forwarding must already be configured in a dedicated isolated lab. Configuration persistence is platform-dependent; these snippets do not establish persistent setup or verify the route.
Linux R1: ip route add 203.0.113.0/24 via 198.51.100.2IOS XE R1: ip route 203.0.113.0 255.255.255.0 198.51.100.2Linux R2: ip route add 192.0.2.0/24 via 198.51.100.1IOS XE R2: ip route 192.0.2.0 255.255.255.0 198.51.100.1IPv6 and default routes
A default route is a general fallback, not an instruction to send all traffic to one gateway regardless of more specific routes. IPv4 uses 0.0.0.0/0; IPv6 uses ::/0. For a separate IPv6 paper topology assume a connected transit 2001:db8:0:1::/64 with R2 at 2001:db8:0:1::2. The examples below reach a remote LAN; a separate default illustration uses the same reachable gateway. Use an outgoing interface as well when an IPv6 link-local gateway requires interface scope. Do not change a real default route or install both default directions blindly; that can produce loops.
Linux: ip -6 route add 2001:db8:2::/64 via 2001:db8:0:1::2IOS XE: ipv6 route 2001:db8:2::/64 2001:db8:0:1::2Linux default illustration: ip -6 route add default via 2001:db8:0:1::2IOS XE default illustration: ipv6 route ::/0 2001:db8:0:1::2Verify without changing a network
For an approved isolated Linux lab, ip route show lists routes and ip route get 203.0.113.10 requests a lookup; neither sends a test packet to that address. Cisco IOS XE show ip route displays routing information. Read outputs on both routers, confirm gateway reachability, then compare the permitted forward and return paths and neighbor state. A lookup alone cannot validate application delivery. If an approved configuration change is needed, save a baseline and use a reviewed rollback plan. Here use only the recorded paper topology.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Static and default routes — knowledge check
Apply routing and static-route reasoning to fictional networks.
In the paper topology, what next hop should R1 use for B’s LAN?
What route is needed on R2 for replies to A, absent a default?
Which is the IPv6 default prefix?
What does Linux ip route get provide?
The request arrives but no reply returns. What is a useful first route check?