Gateway and router
Follow a non-local packet through the default gateway and connect the logical path to real office equipment.
- Explain when a host uses its default gateway.
- Distinguish router, switch and wireless access point roles in a small network.
- Network foundations
- IP addressing
- Network interface
- Packet
On this page
Why this matters
Your computer does not send every packet directly to its final destination. It first decides whether the destination is local. For a non-local destination, a configured route points to a next hop. The common fallback is the default gateway.
See the exact decision
- 01192.0.2.10/24Is the destination local?
- 02ASend directly on the local network192.0.2.0/24
- 02BSend to the default gateway192.0.2.1
- 03Router chooses the next networkDestination network
The host chooses the gateway; the router forwards between networks.
A router forwards packets between networks. A default gateway is the router address a host uses when no more specific route matches. The host chooses the gateway; the router then makes its own forwarding decision.
See the network as an infographic

- 1Internet
- 2Modem / ONT
- 3Router
- 4Switch and wired devices
- 5Wireless access point
- 6Wireless devices
Educational infographic. Follow the arrows from the internet edge to the router and switch; wired devices branch from the switch, while Wi-Fi devices connect through the access point.
The switch connects wired devices on the local network. The access point connects wireless devices to that network. The router connects the local network toward another network. Real devices may combine several roles in one enclosure.
Try it
What happened
ip address showed the interface and local address. ip route showed default via 192.0.2.1: that is the next hop for destinations without a more specific route. The simulated ping observed a reply from the gateway only; it did not prove internet, DNS or application health.
Common mistakes
- Router and default gateway are related terms, not perfect synonyms: “gateway” describes the host's configured next hop; “router” describes a forwarding role.
- A switch normally connects devices within a local network; it is not automatically the internet edge.
- An access point provides wireless access; it does not replace every routing function.
You can now follow an address to another network; next learn how a name becomes that address.
Recommended next topic
DNS →
Why this comes nextName resolution, records, caching, commands and the trust boundaries around DNS.