Skip to main content
networking

Gateway (Default Gateway)

A default gateway is the router a host sends packets to when the destination is not on the local subnet. Every host needs a default gateway to reach the internet or other networks. If the gateway is unreachable, all off-subnet communication fails – even if the host has a valid IP and DNS.

Definition

The default gateway is the next-hop router for traffic destined outside the local subnet. When a host wants to reach an IP not in its subnet (determined by ANDing the destination IP with the subnet mask), it sends the packet to the gateway's MAC address. The gateway then routes the packet toward the destination. In home networks, the default gateway is the ISP router (e.g., 192.168.1.1). In enterprise networks, it is often the VLAN's SVI (Switched Virtual Interface) on a Layer 3 switch. DHCP assigns the default gateway automatically (option 3). Redundant gateways use VRRP (Virtual Router Redundancy Protocol) or HSRP (Hot Standby Router Protocol) to failover if the primary router dies – both present a shared virtual IP that clients use as their gateway.

Examples

  • ip route show default displays the default gateway
  • route add default gw 192.168.1.1 sets default gateway
  • DHCP option 3 (routers): pushes gateway to clients automatically

Related Protocols

Related Terms