A router only knows its directly connected networks. Static routes tell it about the rest, a default route handles "everything else," and HSRP gives hosts a redundant gateway.
Why: a router forwards only to networks it knows about — directly connected ones are automatic, but remote networks must be learned, and the simplest way is a static route you type in. When: use static routes for small or stub networks; use a default route (0.0.0.0/0) to send all unknown traffic toward the internet. Where: dynamic protocols (next lessons) scale this for larger networks.
! Reach a specific remote network via the next-hop router:
R1(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2
! Default route — "everything I don't have a route for goes here":
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1
R1# show ip route ! S = static, S* = default, C = connectedWhy: show ip route is the single most important troubleshooting command — it shows every network the router can reach and how it learned each one, so most routing problems are visible here. When: check it any time traffic is not flowing. Where: the code letter (C connected, S static, O OSPF, B BGP) tells you the source, and the most specific (longest) prefix wins.
R1# show ip route
C 10.0.0.0/24 is directly connected, Gig0/0
S 192.168.20.0/24 [1/0] via 10.0.0.2
O 192.168.30.0/24 [110/2] via 10.0.0.2 <- learned via OSPF
S* 0.0.0.0/0 [1/0] via 203.0.113.1 <- default route
Longest-prefix match wins: a /24 beats the /0 default for its addresses.Why: hosts have a single default gateway IP, so if that router dies they are cut off — First-Hop Redundancy Protocols like HSRP let two routers share one virtual gateway IP, with a standby taking over instantly on failure. When: use HSRP (Cisco) or VRRP (standard) wherever gateway uptime matters. Where: hosts point at the virtual IP and never know which physical router is active.
! Both routers share virtual IP 192.168.10.1 (the hosts' gateway).
! R1 — higher priority + preempt = the active router:
R1(config)# interface vlan 10
R1(config-if)# standby 1 ip 192.168.10.1
R1(config-if)# standby 1 priority 110
R1(config-if)# standby 1 preempt
! R2 — default priority 100 = standby, takes over if R1 fails.
R1# show standby brief