Share on Facebook Share on Twitter Email
Answers.com

Default gateway

 

The router used to forward all traffic that is not addressed to a station within the local network or local subnet. Its primary purpose in most SOHO applications (homes and small businesses) is to direct Internet traffic from the local network to the cable or DSL modem, which connects to the Internet service provider (ISP).

Default IP of Default Gateway

The default IP address assigned by vendors of SOHO routers is often 192.168.0.1 or 192.168.1.1. See IP address, router and default IP.

Download Computer Desktop Encyclopedia to your iPhone/iTouch

Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Wikipedia: Default gateway
Top

A gateway is a node (a router) on a TCP/IP Network that serves as an access point to another network.
A Default Gateway is the node on the computer network that is chosen when the IP address does not match any other routes in the Routing Table.

In homes, the gateway is usually the ISP-provided device that connects the user to the Internet, such as a DSL or cable modem.

In enterprises, however, the gateway is the node that routes the traffic from a workstation to another network segment. The default gateway is commonly used to be the node connecting the internal networks and the outside network (Internet). In such a situation, the gateway node could act as a proxy server and a firewall. The gateway is also associated with both a router, which uses headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.

In other words, it is an entry point and an exit point in a network.

Contents

Usage

A default gateway is used by a host when an IP packet's destination address belongs to someplace outside the local subnet. The default gateway address is usually an interface belonging to the LAN's border router.

Example 1

An office network is composed of five hosts and a router:

Hosts addresses:

  • 192.168.4.3
  • 192.168.4.4
  • 192.168.4.5
  • 192.168.4.6
  • 192.168.4.7

Router (this side) address:

  • 192.168.4.1

The network's subnet mask is:

  • 255.255.255.0

Thus the usable network ranges from addresses 192.168.4.1 to 192.168.4.254. The addresses 192.168.4.0 and 192.168.4.255 are defined with special functions.

The office's hosts will send packets addressed to IPs within this range directly, by resolving the destination IP address into a MAC address through an ARP sequence (if not already known through the host's ARP cache) and then enveloping the IP packet into a layer 2 (MAC) packet addressed to the destination host.

Packets addressed outside of this range (for this example, a packet addressed to 192.168.12.3) are instead sent to the default gateway address, in this case to 192.168.4.1, which is resolved into a MAC address as usual. Note that the destination IP address will stay 192.168.12.3, it is just the next-hop physical address that is used, in this case it will be the router's interface physical address

Example 2

A network with three routers and three hosts, connected to the Internet through Router 1

Hosts addresses:

  • PC1 10.1.1.100, Default Gateway 10.1.1.1
  • PC2 172.16.1.100, Default Gateway 172.16.1.1
  • PC3 192.168.1.100, Default Gateway 192.168.1.1
  • Router 1
  Interface 1 85.85.85.85 (Public IP)
Interface 2 10.1.1.1
  • Router 2
  Interface 1 10.1.1.2
Interface 2 172.16.1.1
  • Router 3
  Interface 1 10.1.1.3
Interface 2 192.168.1.1

Network mask in all networks 255.255.255.0

If the routers don't have some sort of Routing Information Protocol (most have) to discover which network each router is connected to, then the routing table of each router must be set up.

Router 1

Network ID Network mask Gateway Interface (could vary a lot) Cost (decreases the TTL)
0.0.0.0 0.0.0.0 Given by ISP (i.e 85.85.85.1) eth0 (Ethernet 1st adapter) 10
10.1.1.0 255.255.255.0 10.1.1.1 eth1 (Ethernet 2nd adapter) 10
172.16.1.0 255.255.255.0 10.1.1.2 eth1 10
192.168.1.0 255.255.255.0 10.1.1.3 eth1 (Ethernet 2nd adapter) 10


Router 2

Network ID Network mask Gateway Interface (could vary a lot) Cost (decreases the TTL)
0.0.0.0 0.0.0.0 10.1.1.1 eth0 (Ethernet 1st adapter) 10
172.16.1.0 255.255.255.0 172.16.1.1 eth1 (Ethernet 2nd adapter) 10

Router 3

Network ID Network mask Gateway Interface (could vary a lot) Cost (decreases the TTL)
0.0.0.0 0.0.0.0 10.1.1.1 eth0 (Ethernet 1st adapter) 10
192.168.1.0 255.255.255.0 192.168.1.1 eth1 (Ethernet 2nd adapter) 10

Router 2 and 3 just manage their network and their default gateway, router 1 manage all routes within the internal networks.

Accessing internal resources If PC2 (172.16.1.100) need resources from PC3 (192.168.1.100), it has no route to 192.168.1.0 and therefore PC2 will send this to its Def.GW (Router 2), Router 2 have no route to that network either, and will send to its Def.GW (Router 1). Router 1 have a route for this network (192.168.1.0) and will route it to Router 3, which will send the packets to PC3, the packet will then travel back the same way to PC2

Accessing external resources If any of the computers try to access a webpage on the Internet, like http://en.wikipedia.org/, the destination will first be resolved to an IP address by using DNS-resolving. The IP-address could be 91.198.174.2. In this example, none of the internal routers know the route to that host, so they will forward the packet through router 1's gateway or default route. Every router on the packet's way to the destination will check if they match any network routes and send them through that route or if unknown, sends it to their default route. Each router on its way will store the packet ID and where it came from so that it can pass the request back to previous sender. The packet contains source and destination, not all router hops. At last the packet will arrive back to router 1, which will check for matching packet ID and route it accordingly through router 2 or router 3 or directly to PC1 (which was connected in the same network segment as router 1)

The packet doesn't return If router 1 does not have any route to 192.168.1.1, and PC3 try to access a resource outside its own network, then all routing will work until the reply is fed back to router 1. Since the route is unknown to router 1, it will go to router 1's Def.GW, and never reach router 3. In the logs of the resource they will trace the request, but the requestor will never get any information. The packet will die because the TT_L-value will be decreased to less than 1 when it is travelling through the routers or the router will see that it has a private IP and discard it. This could be discovered by using Pathping (windows), since you only can ping until that router which have no route or wrong route. Be aware that some routers will not reply to ping.

References


External links


 
 

 

Copyrights:

Computer Desktop Encyclopedia. THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2009 Computer Language Company Inc.  All rights reserved.  Read more
Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Default gateway" Read more