Glossary Networking

Default gateway

The default gateway is the router a device sends traffic to when the destination is outside its own subnet.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

A device compares each destination with its own subnet mask. Local destinations are reached directly; anything else goes to the gateway, which is often the first address in the subnet, such as 192.168.1.1. The gateway is set by hand or handed out by DHCP, and it must sit on the device's own subnet. To reach it, the device looks up the gateway's MAC address with ARP and sends the frame there, while the IP destination stays the final host.

Why it matters

A wrong or missing gateway means a device can talk to its neighbours but not reach the internet: printers on the LAN work, websites do not. A gateway outside the device's subnet is rejected or unreachable.

Example

A host is 192.0.2.10/24 with gateway 192.0.2.1. Traffic to 192.0.2.50 is inside 192.0.2.0/24 and goes directly; traffic to 198.51.100.7 is not, so it is handed to 192.0.2.1. On Linux, ip route shows this as:

default via 192.0.2.1 dev eth0
192.0.2.0/24 dev eth0 proto kernel scope link src 192.0.2.10
AdSense Placeholder
Slot: footer_leaderboard