What Is a Default Gateway?
A default gateway is the router or multilayer-switch address a host uses to reach destinations outside its own IP network. It is the host's default next hop for remote traffic—including most traffic headed to the Internet.

What Is a Default Gateway in Networking?
A router, firewall or multilayer switch can act as a network gateway. Its gateway IP must normally be in the same subnet as the host interface using it. For example, a host at 192.168.1.20/24 could use 192.168.1.1 as its IPv4 default gateway.
Why Is a Default Gateway Needed?
An Ethernet host can deliver a frame directly only on its local Layer 2 network. When the destination IP belongs to another subnet, a router must forward the packet between networks. The default gateway gives the host a local router address to use when it has no specific route for that remote destination.
Same-Subnet Traffic Does Not Use the Default Gateway
Suppose two hosts use network 192.168.1.0/24. Host A is 192.168.1.1 and Host B is 192.168.1.2. Host A applies its subnet mask to both addresses and sees that the resulting network address is the same.
| Value | Decimal | Binary | AND result |
|---|---|---|---|
| Source | 192.168.1.1 | 11000000 10101000 00000001 00000001 | 192.168.1.0 |
| Destination | 192.168.1.2 | 11000000 10101000 00000001 00000010 | 192.168.1.0 |
| Subnet mask | 255.255.255.0 | 11111111 11111111 11111111 00000000 | — |
- The host applies the /24 mask and confirms that the destination is local.
- It broadcasts an ARP request asking for 192.168.1.2's MAC address.
- Host B replies with its MAC address.
- Host A builds an Ethernet frame addressed directly to Host B and encapsulates the IP packet inside it.
How a Default Gateway Works for Remote Traffic
Now place the hosts in different networks: 192.168.1.0/24 and 192.168.2.0/24. The router has one interface in each subnet. Host A uses 192.168.1.254 as its gateway, while Host B uses 192.168.2.254.
GW 192.168.1.254
GW 192.168.2.254
| Value | Decimal | Binary | AND result |
|---|---|---|---|
| Source | 192.168.1.1 | 11000000 10101000 00000001 00000001 | 192.168.1.0 |
| Destination | 192.168.2.1 | 11000000 10101000 00000010 00000001 | 192.168.2.0 |
| Subnet mask | 255.255.255.0 | 11111111 11111111 11111111 00000000 | — |
- Host A applies its subnet mask and determines that 192.168.2.1 is remote.
- Its routing table matches the default route, whose next hop is 192.168.1.254.
- Host A uses ARP to learn the MAC address of 192.168.1.254—not the remote host.
- It builds a frame for the gateway and places the unchanged IP packet inside.
- The router removes the incoming frame, performs a route lookup, decreases TTL and creates a new frame for the next link.
- After routing, Host B replies through its own default gateway at 192.168.2.254.
What Changes in the Frame and Packet?
Ethernet frame from Host A to router
- Source MAC
- Host A MAC
- Destination MAC
- Gateway MAC
IP packet inside the frame
- Source IP
- 192.168.1.1
- Destination IP
- 192.168.2.1
The Layer 2 frame is replaced at every routed hop. The source and destination IP addresses normally remain end to end, although NAT may translate them at an Internet edge. A router also decreases the IPv4 TTL and recalculates the IPv4 header checksum.
Default Gateway and the Routing Table
Operating systems store a default route in the host route table. In IPv4, the route is written as 0.0.0.0/0; in IPv6, it is ::/0. The zero-length prefix matches every address, but a more-specific route wins through longest-prefix matching.
| Destination | Meaning | Next hop |
|---|---|---|
192.168.1.0/24 | Directly connected local network | Send directly through the interface |
10.20.0.0/16 | Specific remote network | Use its configured next hop |
0.0.0.0/0 | Everything else | Use the default gateway |
A default gateway and a default route describe two sides of the same host behavior: the route is the routing-table entry, and the gateway is the next-hop address selected by that entry.
How a Device Gets Its Default Gateway
DHCP configuration
A DHCP server normally supplies the IPv4 address, subnet mask, default gateway and DNS servers. In DHCPv4, the router value is commonly delivered through Router Option 3.
Static configuration
An administrator manually enters the address, prefix, gateway and DNS values. The gateway must be reachable through the configured interface and belong to an appropriate on-link subnet.
For IPv6, hosts commonly learn a default router from Router Advertisements. DHCPv6 can provide other configuration, but the IPv6 default-router function comes from Neighbor Discovery router information.
How to Find Your Default Gateway
Windows
Open Command Prompt and run:
ipconfigRead Default Gateway under the active Ethernet or Wi-Fi adapter. PowerShell users can run Get-NetRoute -DestinationPrefix 0.0.0.0/0.
Linux
Open a terminal and run:
ip routeThe address after default via is the gateway. For IPv6, use ip -6 route.
macOS
Open Terminal and run:
route -n get defaultRead the gateway field. You can also open the active network service's details and view its router address.
Android
Open Wi-Fi settings, select the connected network and view its network details. The value may be labeled Gateway or Router; menu names vary by manufacturer.
iPhone or iPad
Open Settings → Wi-Fi, tap the information button beside the connected network and read the Router value.
Home router
The gateway is normally the Wi-Fi router's LAN IP, often 192.168.0.1 or 192.168.1.1. Do not assume—check the connected device's route information.
Default Gateway Comparisons
Default gateway vs router
A router is a device or Layer 3 function that forwards packets. A default gateway is the particular router address a host selects for unmatched remote destinations.
Default gateway vs IP address
The host IP identifies the host interface. The gateway IP identifies the local next hop used to leave the subnet. They must be unique and cannot normally be the same address.
Default gateway vs DNS
The gateway forwards packets between networks. DNS translates names such as example.com into IP addresses. A working gateway does not guarantee working DNS, and vice versa.
Default gateway vs DHCP
DHCP provides network settings; it does not normally forward the client's traffic. One setting DHCP supplies is the default gateway address.
Gateway vs modem
A modem terminates an access technology such as cable or DSL. A home gateway often combines modem, router, switch, Wi-Fi, firewall, DHCP and NAT functions in one box.
Static route vs default gateway
A specific static route matches a defined network. A default route is the least-specific fallback. The default gateway is its next hop on a host.
Default Gateway Troubleshooting
route print or Get-NetRoute on Windows, ip route on Linux, or netstat -rn on macOS.arp -a for IPv4 or the platform's neighbor table to see whether the gateway IP resolves to a MAC address.Useful checks include the Ping and Latency Checker, DNS Lookup and Subnet Calculator.
What Is a Default Gateway? Frequently Asked Questions
What does a default gateway do?
It receives traffic that a host cannot deliver directly on its local subnet and routes that traffic toward the destination network.
Is the default gateway always a router?
It is a Layer 3 forwarding function. In homes it is usually a Wi-Fi router. In enterprise networks it might be a router, firewall, multilayer-switch SVI or virtual HSRP/VRRP address.
What happens if the default gateway is wrong?
Local-subnet traffic may still work, but remote networks and Internet access usually fail because frames are sent to an incorrect or unreachable next hop.
Can a network have multiple default gateways?
Yes. Hosts can install multiple default routes and choose using metrics or policy. Networks also use first-hop redundancy protocols so several routers can present one resilient virtual gateway.
Does every device require a default gateway?
No. A device that communicates only on its local subnet does not need one. It needs a gateway when it must reach another IP network.
What is the default gateway for a home network?
It is typically the home router's private LAN address, often 192.168.0.1 or 192.168.1.1. The actual value should be read from the device's network settings.
Does a host send remote traffic to the gateway's IP address?
The packet keeps the remote destination IP. On the local link, the Ethernet frame uses the gateway's MAC address as its destination.
Can the default gateway be outside the host's subnet?
Normally the next-hop gateway must be on-link so the host can resolve and reach it directly. Some systems support special on-link routes or point-to-point behavior, but those are exceptions rather than normal LAN design.