What is a Default Gateway?
A default gateway is the device your computer sends traffic to when the destination is not on its own local network. In a home or small office that device is almost always your router. It is the doorway out of your subnet, and without it your machine can talk to its neighbours but nothing beyond them.
The decision every device makes
Every time your computer wants to send a packet, it asks one question: is the destination on my local subnet, or somewhere else?
It answers this using its own IP address and subnet mask. Say your laptop is 192.168.1.50 with a mask of 255.255.255.0 (a /24). That means the local network is 192.168.1.0 through 192.168.1.255.
- Destination
192.168.1.20? Same subnet. The laptop sends it directly to that device. - Destination
8.8.8.8? Different subnet. The laptop has no idea how to reach it, so it hands the packet to the default gateway and lets the gateway figure out the next hop.
That is the whole job. The gateway is the “I don’t know where this goes, you deal with it” address.
Why it is usually .1
By convention the gateway gets the first usable address in the subnet, so on a 192.168.1.0/24 the router is typically 192.168.1.1. There is nothing magic about .1; you could put the router on .254 and it would work exactly the same. It is just a widely followed habit that makes networks predictable. The one rule is that the gateway must be an address inside the same subnet as the devices using it, otherwise they cannot reach it to hand off their traffic.
How to find your default gateway
| System | Command | Look for |
|---|---|---|
| Windows | ipconfig | ”Default Gateway” |
| macOS / Linux | ip route or netstat -rn | the “default” route |
| Most routers | check the sticker / admin page | LAN IP address |
On Windows the output line reads something like Default Gateway . . . : 192.168.1.1. On Linux, ip route shows a line beginning with default via 192.168.1.1.
Common gateway mistakes
A surprising number of “I have an IP but no internet” problems come down to the gateway:
- Gateway outside the subnet. If a device is configured as
192.168.1.50/24but the gateway is set to192.168.2.1, the device cannot reach the gateway at all, because192.168.2.1is not in its local range. Traffic to the internet silently fails while local traffic works fine. - Wrong mask, right gateway. Set the mask too small and the device thinks half its real neighbours are “remote” and tries to route them through the gateway, which may or may not cope. Set it too large and it tries to deliver internet traffic locally and never reaches the gateway.
- No gateway at all. Perfectly fine for an isolated network (a lab, a storage VLAN). The devices can reach each other but have no path off the subnet, which is sometimes exactly what you want.
This is where a calculator earns its keep: getting the network address, range, and a sensible gateway right before you start typing addresses into devices saves a lot of guessing later.
Gateways and subnetting
When you split one network into several subnets, each subnet needs its own gateway, because a gateway only serves devices in its own range. Split a /24 into four /26 subnets and you now have four separate local networks, each wanting its own .1 (or whichever address you choose) on the router or layer-3 switch. Planning that out is exactly what the VLSM planner is for.
Try it
Open the subnet calculator, enter your own network (for example 192.168.1.0/24), and note the usable range. The first usable address is the conventional spot for your gateway. If you are new to the local-versus-remote idea, the subnetting guide walks through how the mask draws that boundary.