ak47 wrote:
> Thanks for the reply - I will read the HOW-TO.....
>
> To clarify - I do have an internal network using a westell adsl
> modem/router for normal use with 192.168.1.* (the router/modem is
> 192.168.1.1).
>
> I added this Linux box on the network to play with and wanted it to
> host some websites which I plan but also to serve files to the
> internal network hence the two NIC's.
If I understand that correctly, the clients in that 192.168.1/24 net
connect to the internet via that Westell device, an _not_ via Your
linux box.
If that is the case:
> I wanted to kow (as both the networks can access the internet, either
> internal thru the NAT or direct using eth1 - the external IP'd NIC) if
> I was to type www.google.com in a web browser, which NIC would it use?
> What IP address would the target server see?
This depends on how Your routing is configured. Try
"/sbin/route -n"
and it will (most likely) show a "host entry" (netmask 255.255.255.255)
for Your (public) eth1 pointing at Your ISP's side of the connection
(in fact, their router). Then You will find one line that tells Your
kernel to use eth0 for destinations inside the 192.168.1.0/255.255.255.0
subnet.
The last route, with some sort of "catch all" destination 0.0.0.0, is
referred to as the default route. This is the one that will be used
when no earlier route matched the target.
So in Your case, it depends on how that default route is set up. There
are two options:
In this default route, there's a gateway specified. Essentially, this
tells Your kernel to forward all traffic that appears to be non-local
to that gateway machine, which in turn will take care of its delivery.
So You could specify Your Westell with 192.168.1.1 as the default gw,
and Your connection to any public IP except for Your own and that of
Your ISP's router would go via eth0 to that device. Of course all
connections to 192.168.1/24 will also use eth0.
You can, on the other hand, specify the ISP's router as the default
gateway. Then, only packets to Your local net (192.168.1/24) will use
eth0, all others will go via eth1 to Your ISP's router.
In the former case (eth0), any server You contact will see the modem's
IP as the sender address; in the latter case, Your public IP that is
configured on eth1.
> Thanks again for the reply....now for the HOW-TO....
You should. Things are very well explained there, and You will most
certainly understand things a lot better.
Glad to hear You enjoy Linux. Keep going.
Cheers, Jack.
--
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...