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.

Default GatewayARPIP RoutingPacket ForwardingCCNA
What Is a Default Gateway? learning map
Learning map for What Is a Default Gateway? showing the article's core concepts, workflow, practice topics, and troubleshooting path.

What Is a Default Gateway in Networking?

Default gateway definition: the local Layer 3 next hop to which a device sends an IP packet when no more-specific local or remote route matches the destination.

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.

Host address192.168.1.20/24
Gateway address192.168.1.1
Default route0.0.0.0/0
PurposeReach remote networks

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.

Without a default gateway: the host can usually communicate with devices in its own subnet, but it cannot reach remote subnets or the Internet unless another matching route exists.

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.

ValueDecimalBinaryAND result
Source192.168.1.111000000 10101000 00000001 00000001192.168.1.0
Destination192.168.1.211000000 10101000 00000001 00000010192.168.1.0
Subnet mask255.255.255.011111111 11111111 11111111 00000000—
  1. The host applies the /24 mask and confirms that the destination is local.
  2. It broadcasts an ARP request asking for 192.168.1.2's MAC address.
  3. Host B replies with its MAC address.
  4. 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.

ValueDecimalBinaryAND result
Source192.168.1.111000000 10101000 00000001 00000001192.168.1.0
Destination192.168.2.111000000 10101000 00000010 00000001192.168.2.0
Subnet mask255.255.255.011111111 11111111 11111111 00000000—
  1. Host A applies its subnet mask and determines that 192.168.2.1 is remote.
  2. Its routing table matches the default route, whose next hop is 192.168.1.254.
  3. Host A uses ARP to learn the MAC address of 192.168.1.254—not the remote host.
  4. It builds a frame for the gateway and places the unchanged IP packet inside.
  5. The router removes the incoming frame, performs a route lookup, decreases TTL and creates a new frame for the next link.
  6. 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.

Common exam point: a host ARPs for the remote destination only when that destination is local. For a remote destination, it ARPs for the default gateway's local IP address.

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.

DestinationMeaningNext hop
192.168.1.0/24Directly connected local networkSend directly through the interface
10.20.0.0/16Specific remote networkUse its configured next hop
0.0.0.0/0Everything elseUse 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:

ipconfig

Read 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 route

The address after default via is the gateway. For IPv6, use ip -6 route.

macOS

Open Terminal and run:

route -n get default

Read 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

1. Check the address, mask and gatewayConfirm that the gateway is in the local subnet and that another device is not using the same IP address.
2. Verify the active routeUse route print or Get-NetRoute on Windows, ip route on Linux, or netstat -rn on macOS.
3. Ping the gatewayTest the gateway IP. A failed ping may indicate Wi-Fi, cable, VLAN, subnet-mask, ARP, firewall or router problems—but some gateways intentionally block ICMP.
4. Inspect neighbor resolutionUse arp -a for IPv4 or the platform's neighbor table to see whether the gateway IP resolves to a MAC address.
5. Separate routing from DNSTest a known public IP and then a hostname. If the IP works but the name fails, investigate DNS rather than the gateway.
6. Trace the pathUse traceroute or the site's Traceroute Tool. Failure at the first hop points toward the local network or gateway.
7. Refresh dynamic settingsReconnect the interface or renew its DHCP lease. Persistent Windows “Default gateway is not available” errors can also involve adapter drivers, power management or router instability.

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.