The Default Gateway
Lesson 15 of 35 in Coddy's LAN Labs course.
A router in the right place is not enough: each host must be told where to send traffic for other networks. That address is its default gateway, normally the router's interface in the host's own network.
netlab gateway HOST ADDR sets it. Without it, a host with a foreign destination simply gives up: unreachable (different subnet, pc1 has no gateway).
Setting the gateway on the sender is only half the job. Watch what the lab says once pc1 can send but pc3 cannot answer.
Challenge
Easyr1 is addressed in both networks. Ping pc3 from pc1, set pc1's gateway to 192.168.1.1, and ping again.
Expected output:
pc1 -> pc3: unreachable (different subnet, pc1 has no gateway)
pc1: gateway 192.168.1.1
pc1 -> pc3: no reply (pc3 thinks 192.168.1.10 is on a different subnet and has no gateway)Try it yourself
All lessons in LAN Labs
4Routers and Gateways
Two NetworksThe Default GatewayBoth Sides Need a Way BackRouting TablesRecap - Connect the Floors2Addresses on the LAN
Giving a Host an AddressThe First PingWhat ARP LearnedThe Switch Learns TooRecap - First Conversation8Capstone - Fix the Branch
Survey the DamageFix the Address ClashMasks and GatewaysRecap - Prove It WorksPractice on your own: Terminal playground