I have this kind of setup with only one nic in each machine. But I
have a static connection to the internet.  Maybe with DHCP you want
one card for the local lan and another for the DHCP.

In any event, here is my setup, including WIN XP.

I have a multiport switch  which is connected to the
cable modem.
All other machines including the one on the internet are connected to
the switch.    I use Bastille-linux as the firewall on the machine
with an internet address (in my case it is static, but DHCP should
work in the same way with the appropriate line in
/etc/Bastille/bastille-firewall.cfg uncommented).

Here is how my setup works.  Suppose my  /etc/hosts file on all linux
machines looks like

127.0.0.1 localhost

122.133.144.155  ip-host

10.0.0.2  host2
10.0.0.3  host3
10.0.0.4  win-host

The corresponding file in Win XP is
C:\WINDOWS\system32\Drivers\etc\hosts

(Just search on hosts)



Here I have ip-host is the machine on the internet, host2, host3,
are other linux machines, and win-host is the XP machine.
All are connected with cat 5 cable to the
ethernet switch which is connected to the cable modem.

I set up all local machines to use ip-host as the default gateway.
Also, I have a simple cache DNS on ip-host (this may not be necessary,
but is left over from when I did not use a firewall).  Probably, the
DHCP connection will automatically provide DNS to all machines--I
don't know.

Then, on host2, host3, in /etc/rc.d/rc.local, I add the command:

 /sbin/route add -host 122.133.144.155  dev eth0
 /sbin/route add -host 10.0.0.2 dev eth0
 /sbin/route add -host 10.0.0.3 dev eth0
 /sbin/route add -host 10.0.0.4 dev eth0

Now, all machines can use ssh, netscape, etc to the internet.

Suppose your WIN XP machine is win-host

Go into the Network Places part of Control-panel and set the IP
address to be

 10.0.0.4

Set the gateway to be ip-host (or its number).

Test the setup by going to the Command Prompt and typing

ping ip-host

I this gives you back some repeated lines ending with
  TTL=255

you are in business.  Then, e.g. try

ping www.nytimes.com

and you'll see what I mean.

My first guess for 2 nics and DHCP would be to have ip-host as
10.0.0.1 and repeat the above setup.

Good luck,
 sen




hub On 11 Mar 2002, Darren King wrote:

> Right now, I am using a mandrake 8.0 machine to connect to the internet
> using dhcp (@home cable).  I want to set up a network so my windows xp
> (gaming machine) can connect to the internet through my linux machine. I
> want to hide the windows machine behind the linux one to keep it safe.
>
> Do I have to have 2 NIC's in my linux machine?  1 going to the hub and
> one to the cable modem to do this?  are there any good docs on how to
> set this up?
>
> Darren
>
>
>


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to