*** Welcome to piglix ***

Default gateway


A default gateway in computer networking is the node that is assumed to know how to forward packets on to other networks. Typically, in a TCP/IP network, nodes such as servers, workstations and network devices each have a defined default route setting, (pointing to the default gateway), defining where to send packets for IP addresses for which they can determine no specific route. The gateway is by definition a router.

In a home or small office environment, the device, such as a DSL router or cable router that connects the local network to the Internet will act as the default gateway for all network devices.

In enterprise systems, there may be many internal network segments. A device wishing to communicate with an Internet address for example, will forward the packet to the default gateway for their segment. This in turn may pass the packet to a series of further default gateways before it leaves the enterprise. In such a situation, each gateway node may also act as a proxy server and a firewall.

The following are IP addresses might be used with an office network that consists of six hosts plus a router. The six hosts addresses are:

The router inside address is:

The network has a subnet mask of:

The address range assignable to hosts is from 192.168.4.1 to 192.168.4.254. TCP/IP defines the addresses 192.168.4.0 and 192.168.4.255 for special functions.

The office's hosts send packets to addresses within this range directly, by resolving the destination IP address into a MAC address with the (ARP) sequence and then encapsulates the IP packet into a MAC frame addressed to the destination host.

A packet addressed outside of this range, for this example, addressed to 192.168.12.3, cannot travel directly to the destination. Instead it must be sent to the default gateway for further routing to their ultimate destination. In this example, the default gateway uses the IP address 192.168.4.1, which is resolved into a MAC address with ARP in the usual way. The destination IP address remains 192.168.12.3, but the next-hop physical address is that of the gateway, rather than of the ultimate destination.


...
Wikipedia

...