← Lessons

quiz vs the machine

Silver1070

Networking

The Default Gateway

How a host sends traffic to addresses outside its own subnet.

3 min read · intro · beat Silver to climb

On link or off link

When a host wants to send a packet, it first asks a simple question. Is the destination on my own subnet or not? It answers this by applying its subnet mask to both its own address and the destination.

Two paths

  • If the destination is on link, the host resolves the destination MAC with ARP and sends the frame directly.
  • If the destination is off link, the host cannot reach it alone. It hands the packet to its default gateway, the router on its subnet.

The gateway is just an IP address the host is configured with, usually by DHCP. The host sends the packet to the gateway MAC but keeps the final destination IP intact, so the router can forward it onward.

Why it matters

Without a default gateway a host can only talk to neighbors on its own subnet. The gateway is the single doorway to everything else, which is why a wrong gateway setting breaks all outside access while local pings still work.

Key idea

The default gateway is the router a host uses for any destination that is not on its own subnet.

Check yourself

Answer to earn rating on the learn ladder.

1. When does a host send a packet to its default gateway?

2. What symptom suggests a wrong default gateway?