Default Gateway
- In Turkish
- Varsayılan Ağ Geçidi
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
# 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.1Readers 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
- RouterNetworking, p. 25A router is a networking device that forwards packets between different networks, choosing the next hop for each one based on its destination IP address.
- SubnetNetworking, p. 29A subnet is a smaller network carved out of a larger one by splitting its range of IP addresses, which keeps traffic organized, contained, and easier to secure.
- IP AddressNetworking, p. 10An IP address is a numeric label assigned to each device on a network so that data can be routed to it, much like a postal address for a house.
- DHCPNetworking, p. 6DHCP is a network protocol that automatically gives devices an IP address and other settings, such as the router and DNS server, when they join a network.
- ARPNetworking, p. 1ARP is a network protocol that finds the MAC address belonging to an IPv4 address on the local network, so a device knows where to deliver each Ethernet frame.
- NATNetworking, p. 17NAT is a technique in which a router rewrites the IP addresses in passing packets, letting many devices on a private network share one public IP address.
Spotted a mistake or something missing on this page?Suggest an edit