Routes by hand
Three routers stand in a line, each with its own LAN. When a router port gets an address, the router adds a connected route by itself: “this network is plugged in right here.” That is all any router knows so far.
Laptop A pings Laptop C at 192.168.3.10: a tiny “are you there?” message. Its gateway, router 1, looks for 192.168.3.0/24 in its table and finds nothing, so it drops the ping and answers “destination unreachable”.
An administrator types static routes. Each one is a destination network plus a next hop: the neighbour to hand the packet to. Router 1: 192.168.3.0/24 via 10.0.12.2. Router 2: 192.168.3.0/24 via 10.0.23.3.
Now each router knows its next step. Router 1 hands the ping to router 2, router 2 to router 3, and router 3 delivers it on its own LAN, which is connected. Laptop C sends a reply.
The way back
The reply goes to 192.168.1.10. Router 3 has no route back to 192.168.1.0/24, so it drops it. Forgetting the return route is the classic static-routing mistake: every path must work in both directions.
The administrator adds return routes on the far side. Router 3: 192.168.1.0/24 via 10.0.23.2. Router 2: 192.168.1.0/24 via 10.0.12.1. Router 1 needs nothing new: LAN A is connected to it.
The reply retraces the path: router 3, router 2, router 1, Laptop A. The ping works both ways. Four routes, typed by hand, made it happen; no router learned anything by itself.
Defaults and failures
Router 1 gets a default route: 0.0.0.0/0 via the ISP at 203.0.113.1. It matches every address but is the least specific match, so it is used only when nothing better fits, like a website at 198.51.100.7.
The cable between router 2 and router 3 fails. Router 2 loses its route via 10.0.23.3 and drops the ping. Router 1 cannot see the break and keeps sending. The spare cable sits idle: no route uses it.
The administrator adds backup routes over the spare cable with administrative distance 200. Distance is a trust score: lower wins, and a normal static route has 1. A backup “floats” unused while the main route exists.
With the main cable down, router 2 and router 3 use their floating routes. The ping crosses the spare cable, and the reply returns the same way. When the main cable comes back, distance 1 wins again.
Static routes are simple, predictable and cost nothing to run, so they suit small networks that rarely change. But every change and every failure needs a person or a prepared backup. Big networks let routers learn routes themselves.
Commands and tables
;; step 1/12 · connected · local ;; at Router 1, Router 2, Router 3 Router 1: C 192.168.1.0/24 connected AD 0 C 10.0.12.0/24 connected AD 0 C 203.0.113.0/24 connected AD 0 Router 2: C 192.168.2.0/24 connected AD 0 C 10.0.12.0/24 connected AD 0 C 10.0.23.0/24 connected AD 0 C 10.0.99.0/24 connected AD 0 Router 3: C 192.168.3.0/24 connected AD 0 C 10.0.23.0/24 connected AD 0 C 10.0.99.0/24 connected AD 0 C = connected (AD 0), added automatically for every working port AD = administrative distance, a trust score (lower wins), explained in step 10
For clarity the figure only adds the routes needed between LAN A and LAN C. LAN B would need routes on router 1 and router 3 too, written the same way. A floating static route only takes over when the router itself sees the main route fail, for example when its own port goes down. A failure further away stays invisible to it.