Skip to main content

Default Gateway

Updated 3 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/default-gateway

In short

A default gateway is the router a device sends traffic to whenever the destination lies outside its own subnet, acting as the network's exit to other networks.

What is a default gateway?

A default gateway is the address of the router that a device uses to reach anything outside its own subnet. On a home network it is usually the router itself, at an address such as 192.168.1.1, and on a cloud network it is a virtual router provided by the platform. Every device that needs to reach the internet or other networks must know its default gateway, and DHCP normally hands it out along with the device's IP address.

Before sending a packet, a device compares the destination IP address with its own subnet. If the destination is inside the same subnet, the device delivers it directly, using ARP to find the destination's MAC address. If it is anywhere else, the device sends the frame to the default gateway's MAC address instead, leaving the packet's destination IP address unchanged, and the router takes over from there. In a routing table this appears as the default route, written 0.0.0.0/0 for IPv4 or ::/0 for IPv6, which matches every destination not covered by a more specific route.

Think of the default gateway as the front door of an apartment building: to visit a neighbor you walk down the hallway, but to go anywhere else in the city you always leave through the same door. A wrong or missing gateway causes a very recognizable problem: the device can talk to others on the local network but can't reach the internet. Checking the gateway, and pinging it, is one of the first steps in network troubleshooting.

The word gateway is confusing because it names several unrelated things. A default gateway is just a router address in a device's network settings, while an API gateway is a server that manages incoming API requests and a payment gateway is a service that processes card payments. The default gateway is also not the same as the DNS server, although on home networks the same router often plays both roles at the same address.

Key takeaways

  • The default gateway is the router a device uses for every destination outside its own subnet.
  • Local destinations are reached directly; everything else goes through the gateway.
  • It usually comes from DHCP and appears in the routing table as the default route, 0.0.0.0/0.
  • A missing or wrong gateway lets a device reach local machines but not the internet.
  • A default gateway is unrelated to an API gateway, despite the shared word.

Example

Finding and testing the default gatewaybash
# Linux: the "default via" line names the default gateway
ip route show default
# default via 192.168.1.1 dev eth0 proto dhcp

# macOS
route -n get default | grep gateway

# Windows
ipconfig | findstr /i "Gateway"

# Troubleshooting: can we reach the gateway itself?
ping -c 3 192.168.1.1

Readers ask

How do I find my default gateway?

On Linux, run ip route show default; on macOS, route -n get default; and on Windows, ipconfig, which lists it as Default Gateway. On most home networks it is an address such as 192.168.1.1 or 192.168.0.1.

What happens if the default gateway is wrong?

The device can still communicate with other devices in its own subnet, but traffic to anywhere else is sent to the wrong place or nowhere. Websites and other networks become unreachable even though the local network seems fine.

Is the default gateway the same as the router?

Usually, yes: the default gateway is the IP address of the router's interface on your local subnet. The term describes the router's role from the device's point of view, as the next hop for all non-local traffic.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings