What Is a Default Gateway? Routing Tables and Static Routes Explained

Last updated

TL;DR — Key Takeaways
  • Your default gateway is the address your device uses for any traffic leaving the local network.
  • On most home networks, the default gateway is your router, often 192.168.1.1 or 10.0.0.1.
  • A routing table lists every network a device knows how to reach and which gateway to use.
  • A static route is one you add by hand — for a second subnet, a VPN, or a home lab.
  • When the default gateway goes unreachable, local devices still work, but nothing outside the subnet does.

Every network device relies on one address for traffic leaving its local subnet: the default gateway. It decides where a packet goes the moment it can’t reach its destination directly.

This guide covers what a default gateway does and how to find yours. It also covers how routing tables and static routes fit around it.

What is a default gateway?

A default gateway is the IP address a device uses when a destination isn’t on its own local network. Most home routers act as the default gateway, forwarding that traffic toward the internet or another network segment.

Think of it as the exit door for your local network. Every device inside checks whether a destination is a roommate on the same floor or someone outside the building.

If the destination is local, the device sends the packet straight there. If not, the packet goes to the default gateway, which knows the next step toward the wider internet.

On a typical home network, that gateway is your router’s LAN IP, commonly 192.168.1.1 or 192.168.0.1. Your device receives that address automatically from DHCP, specifically option 3 in the DORA handshake.

How does a device decide when to use the gateway?

A device compares a destination address against its own subnet mask. If the destination falls outside that range, the device sends the packet to its default gateway instead.

Say your laptop holds the address 192.168.1.20/24. That mask covers 192.168.1.0 through 192.168.1.255, its local subnet.

A request to another device at 192.168.1.45 stays local, since both addresses share the same /24 range. A request to a website at 93.184.216.34 falls outside that range, so the packet heads to the default gateway instead.

This math is exactly what a subnet calculator automates. Our subnetting beginner’s guide walks through the mask math from scratch if any of this feels unfamiliar.

How to find your default gateway

Windows, macOS, and Linux all show the default gateway through one terminal command. Most home routers also display it on their status or WAN configuration page.

Each platform uses a slightly different command, but every one reports the same address your device already relies on.

Windows

ipconfig

Look for Default Gateway under your active network adapter. For every setting on that adapter at once, run ipconfig /all instead. Our Windows network reset commands guide covers the rest of that output.

macOS

netstat -nr | grep default

The line beginning with default shows the gateway address, alongside the interface carrying it, such as en0.

Linux

ip route | grep default

Older distributions still accept route -n, which lists the same information under the Gateway column.

Router admin page

Log in to your router, commonly at 192.168.1.1 or 192.168.0.1, and check the LAN or status page. That address is the default gateway every device on the network receives.

What is a routing table?

A routing table lists every destination network a device or router knows how to reach. Each entry pairs that network with a gateway and interface to use. Every device, including your laptop, keeps one.

A router’s table can hold thousands of entries. A home laptop’s table usually holds just a handful of entries. That’s the local subnet, the default route, and a few special-purpose ranges like loopback.

Formally, RFC 1812 defines how an IPv4 router must build and use this table when forwarding packets.

How to read a routing table

A routing table row pairs a destination network with a gateway, an interface, and a metric. The most specific matching row wins, and 0.0.0.0/0 is the catch-all default route.

Here’s a simplified example from a home router, similar to what route -n or ip route would print:

DestinationNetmaskGatewayInterfaceMetric
0.0.0.00.0.0.0203.0.113.1WAN0
192.168.1.0255.255.255.00.0.0.0LAN0
10.0.20.0255.255.255.0192.168.1.5LAN10

The first row is the default route. A destination of 0.0.0.0 with a mask of 0.0.0.0 matches every address. It only fires when nothing more specific does.

The second row is a connected route, added automatically for the router’s own local subnet. A gateway of 0.0.0.0 here means “deliver directly, no next hop needed.”

The third row is a manually added static route, sending one specific subnet through a different gateway than the default. That’s the topic of the next section.

When two rows could both match a destination, the router picks the one with the longer, more specific prefix. Our CIDR notation guide explains prefix length if that term is new.

What is a static route?

A static route is a routing table entry you add manually instead of one your router builds automatically. Static routes tell a device exactly how to reach a specific subnet through a specific gateway.

Most home networks never need one. A single router with a single subnet has nothing extra to point traffic toward.

Static routes earn their keep once your network gets more complicated. A few common home-lab cases:

  • A second router or subnet, such as a VLAN or a lab network behind an internal router.
  • Split-tunnel VPN routing, where only specific subnets should travel through the tunnel.
  • Reaching a Tailscale-advertised subnet from a device outside the tailnet, as covered in our Tailscale travel router guide.

Compare that to NAT, which rewrites addresses at the network boundary. A static route doesn’t rewrite anything; it only changes which gateway carries the packet.

How to add a static route

Windows, macOS, and Linux each accept a static route through one command specifying the destination network, mask, and gateway. Most routers also support them through the admin interface.

Windows

route add -p 10.0.20.0 mask 255.255.255.0 192.168.1.5

The -p flag makes the route persistent across reboots. Omit it, and the route disappears the next time the device restarts.

Linux

ip route add 10.0.20.0/24 via 192.168.1.5 dev eth0

This form isn’t persistent by default. Most distributions need the route added to a network manager profile or a startup script to survive a reboot.

macOS

sudo route -n add -net 10.0.20.0/24 192.168.1.5

Like Linux, this route is temporary. A persistent macOS route needs a launch daemon or a third-party network utility.

On most home routers, look for a static routes or advanced routing section in the admin page. That replaces the terminal command shown above. You’ll enter the same three values: destination network, subnet mask, and gateway.

Default gateway vs. router vs. modem

The default gateway is a role, not a device. On most home setups, the router fills that role. The modem only converts the ISP’s signal and has no local routing job of its own.

People use “router” and “gateway” interchangeably, and on a typical home network that’s harmless. The same device does both jobs anyway.

The modem is different. It converts a cable, fiber, or DSL signal into Ethernet and hands that connection to the router. It rarely has a LAN IP your other devices ever talk to.

An all-in-one ISP box blurs this further, combining modem, router, and Wi-Fi access point into one unit. The gateway role still lives inside it, just bundled with the others.

What happens when the default gateway is unreachable

When the default gateway goes unreachable, local devices keep working normally, but nothing outside the subnet does. That includes the internet, DNS lookups, and any other subnet reached through it.

This is a distinctive symptom. Two devices on the same subnet can still ping each other perfectly. That traffic never touches the gateway at all.

The usual causes are a rebooting router, a bad cable, or a Wi-Fi driver issue. A device holding a stale, expired lease can cause it too.

For the full diagnostic sequence, see our network troubleshooting guide. Our Windows network reset commands guide covers the release-and-renew sequence that fixes most stale-lease cases.

Frequently asked questions

What is a typical default gateway IP address?

On home networks, the default gateway is almost always 192.168.1.1, 192.168.0.1, or 10.0.0.1. These come from the private ranges defined in RFC 1918. The exact address depends on your router’s brand and default configuration. Check your device’s network settings if none of these match.

Can a device have more than one default gateway?

A device can technically hold more than one default route, but only one is active at a time on IPv4. Using two active default gateways on the same network causes unpredictable, hard-to-diagnose routing behavior. Multi-homed setups instead rely on static routes and metrics to control which path traffic actually takes.

Why does my default gateway keep changing?

Your default gateway usually changes because your device switched networks, such as moving from home Wi-Fi to a mobile hotspot. It can also change after a router replacement or a DHCP lease renewal that assigns different settings. If it changes while you stay on the same network, that points to a router or DHCP misconfiguration worth investigating.

Do I need a static route on a home network?

Most home networks never need one. A single router serving a single subnet already has everything it needs in its default and connected routes. Static routes become useful once your network gets more complex. That includes a second router, a VLAN, a home lab subnet, or a split-tunnel VPN.

What happens if my device and the gateway aren’t on the same subnet?

A device cannot use a gateway address outside its own subnet. If a device’s gateway address falls outside its own subnet mask, that configuration is invalid. It typically cannot reach anything beyond the local network at all. This is a common manual-configuration mistake. It usually shows up as internet access failing right after a static IP change.

Is the default gateway the same as my router’s IP address?

On almost every home network, yes. The router’s LAN IP address is the same address your devices use as their default gateway. The two terms describe the same address from different angles. One names the device, and the other names its routing role.

Secret Link