Why does a PC need a default gateway if the switch already connects everything?
All our PCs connect to the same switch and talk fine without any gateway configured. Then reaching the server VLAN fails until the gateway is set. What is the gateway actually deciding?
1 Answer
The gateway is the host's answer to one question: "the destination is not in my subnet — who do I hand this to?" Every host does the same math before sending: destination AND my mask vs my address AND my mask. Same result → local delivery: ARP for the destination directly, switch forwards, no router involved (that's why same-subnet traffic works gateway-less). Different result → the host ARPs for the gateway's MAC and sends the packet there, still addressed at L3 to the final destination. No gateway configured = off-subnet packets have nowhere to go and are dropped by the host itself — nothing even hits the wire. A classic symptom: ping by IP works locally, everything remote fails, and the ARP table shows no gateway entry.