Network foundationsUnit 3 of 3
Beginner24 minIn reviewreview

Gateway and router

Follow a non-local packet through the default gateway and connect the logical path to real office equipment.

What you will learn
  • Explain when a host uses its default gateway.
  • Distinguish router, switch and wireless access point roles in a small network.
Know this first
  • Network foundations
  • IP addressing
  • Network interface
  • Packet
Start this unit
Last verifiedReview every 365 days
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

How a packet leaves the local networkRFC 1122 / RFC 1812
  1. 01192.0.2.10/24Is the destination local?
  2. 02ASend directly on the local network192.0.2.0/24
  3. 02BSend to the default gateway192.0.2.1
  4. 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

How a small-office network is connectedInfographic / generated / reviewed 2026-09-21
  1. 1Internet
  2. 2Modem / ONT
  3. 3Router
  4. 4Switch and wired devices
  5. 5Wireless access point
  6. 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

TRY IT HERE

Separate the interface address, default route and reachability observation.

Deterministic simulator: no real shell, network or access to your files.

Suggested sequence

$ …

What happened: 192.0.2.10 is the host address; 192.0.2.1 is the default gateway in this reserved fixture.

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.
Next stepContinue to DNS

You can now follow an address to another network; next learn how a name becomes that address.