IP fundamentals

What is a default gateway?

A default gateway is the next hop used when a routing table has no more specific matching route.

Updated

Local destinations

With 192.168.1.20/24, another 192.168.1.x address is ordinarily on-link. The host uses link-layer discovery rather than sending every packet to the router.

Remote destinations

A default IPv4 route is written 0.0.0.0/0, and an IPv6 default route is ::/0. A more specific prefix wins. The gateway must be reachable on the local link.

When it goes wrong

A wrong gateway can allow local printing but block external traffic. A VPN or multiple network interfaces may install additional routes. Check the active routing table rather than assuming that the Wi-Fi icon proves connectivity.

Route selection example

For a host at 192.168.1.20/24, 192.168.1.50 is ordinarily a local destination. Traffic to 192.0.2.50 requires another route; a default route may direct it to 192.168.1.1. The router must have its own onward route and policy allowing the traffic.

Step-by-step example

Use a sample LAN with 192.168.1.20/24 and gateway 192.168.1.1.

  1. 01

    Identify the local network

    The /24 fixes the first 24 bits, giving 192.168.1.0–192.168.1.255. Your device consults its routes before choosing how to send a packet.

    Device
    192.168.1.20
    Local prefix
    192.168.1.0/24
    Illustration · example, not a live result
  2. 02

    Compare two destinations

    A destination at 192.168.1.50 is on this illustrative local subnet. An external destination such as 192.0.2.10 is outside it. Without a more specific route, the default route points to the gateway.

    192.168.1.50
    On-link
    192.0.2.10
    Via gateway
    Illustration · example, not a live result
  3. 03

    Check configuration

    In your operating system's network settings, inspect the default gateway. A missing or incorrect gateway can prevent access beyond the LAN even when local devices work. Do not replace settings on a managed network without permission.

    Local traffic
    Device → peer
    Remote traffic
    Device → gateway
    Illustration · example, not a live result

Check your understanding

The gateway is the next hop, not the remote website's address.

Try this tool →
Working through a learning path?

Record your own progress on this browser. No account required.

Learning paths →

Try this

Inspect your device's gateway and compare the local address with its subnet; do not change managed-network routes.

IPv4 / IPv6 subnet calculator →

Technical references