On Tue, 16 Mar 1999, Daniel Nichter wrote:
> Say I set, for example, the default gateway on a Windows
> box to 192.168.1.1 where 192.168.1.1 is a Linux server,
> on the same LAN, masquerading data to and from the Internet
> on it's ppp interface for the internal LAN.
>
> When, from the Windows box, I ping some address on the
> Internet, does the Windows box put on and extra IP
> header w/ a dest address of 192.168.1.1 on top of
> ping packet (IP header + ICMP header) to build a pack
> like:
> [IP header: dest 192.168.1.1][IP header: dest 202.192.13.2][ICMP header]
> so that way the Linux box will pick up the packet, strip
> the first IP header, see the second IP header and say
> "I should masquerade this packet through my ppp0."
Nope. The IP layer only cares about the *next hop*. The machine at the
other end of the next hop is expected to know how to forward the packet
toward the destination address.
The next hop is determined by examining the route table. If you only
have one interface, and the default route points to it, the decision is
made: any packet will go to the one and only interface. The Windows box
sends the packet to the machine named in the default route, trusting it
to send that packet onward.
> If the Windows box didn't add the second header addressed
> to the Linux server, the Linux server wouldn't pick it
> up since the dest address in the packet wouldn't be addressed
> to it, correct? Or does a box that masquerades pick anything
> off the wire?
No, *any* IP node (masquerading or not) accepts *any* packet that is
addressed to its Ethernet adaptor(s) or that comes in on a point-to-point
link, *then* looks at the IP header and decides whether to deliver the
packet to a local process, forward it out some interface, return an error
indication to the sender, or silently throw it away.
It's like handing an addressed letter to the postman, except that in
networking your postman can hand a batch of letters to a bigger postman,
who hands it to a still bigger postman, who hands it to another mid-size
postman, who hands it to a distant small postman, who puts it in someone
else's box. Each middleman looks at the address and figures out who
among his associates can get the letter closer to that mailbox.
--
Mark H. Wood, radical centrist [EMAIL PROTECTED]
Charlie, put down that Glitter Glue -- it's time to show the audience
some content!
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]