On 17/06/02 08:41 -0000, Amitava Sen wrote:
> Dear Kumar,
> 
> Simply put a GATEWAY is the out/in path for IP packets
>  from a network to another. DEFAULT GATEWAY means that
> it is the first IP that the app should send to to reach outside
> networks. You can have multiple GATEWAYS. In that case
A default gateway is the LAST gateway. It is also known as the gateway
of last resort.

Routing involves checking for the ip address in a table, figuring out
the most specific route and sending the packet to the corresponding
router on the corresponding interface.
The most specific match wins, so if you have a /24 and two /25 routes
for the same block, then the /24 is worthless since the /25s will always
override. The default gateway has a mask of 0.0.0.0, implying a least
specific route.

> if you check the routing table on any node you will see
> them listed along with a METRIC number, the DEFAULT
> GATEWAY will have the lowest. Your apps would try
> sending packets to outside networks starting with the lowest
> and if failed try the next highest metric.
 
> In your case the what I can see is that your m/c is acting as
> your gateway for your LAN. One NIC has your PRIVATE
> address and the other has a PUBLIC. First your m/c should
> know that all packets NOT of private address should be
> handed to the NIC[Public] -- enable IP forwarding.
> Second all nodes should have the address of the
> NIC[Private] as their DEFAULT GATEWAY.
> 
> So, it works like this. NODE1 wants to send a packet to
> www.pcquest.com, looks up its routing table, gets the IP of
> the DEFAULT GATEWAY and send it there. Now your
> gateway m/c on receiving the packet just forwards it to the
> NIC[Public]. NIC[Public] forwards it to the router for actual
> delivery.
Of course, you forgot to mention the need for masquerading here
(translating RFC 1918 address space to publically routable address
space).
The working is more like:
The machine looks up the ip address of www.pcquest.com, looks for a
route to that address. If it does not find a specific route, it sends
the packet to the default gateway, which is supposed to know how to
handle that packet.

Devdas Bhagat


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to