Help - Search - Members - Calendar
Full Version: Using Linux As A Gateway
Linuxhelp > Support > Technical Support
Could someone please help me? I have redHat9.0, 2 network cards and want to just linux as my gateway to the internet for my XP network. I am using webmin because i dont really know how to get around in linux. My linux box can surf the net but none of my XP boxs can get out. I can ping both network cards from my XP box. I have tried to go into route and gateways and set it up there with no luck. Do i need to do something else after the static route is set? or am i going about it all wrong? I have dhcp set for my external and static for internal. The reason i am doing this is cause i have 2 modems and 1 is already on my router.

Thanl you for any help smile.gif
I'm probally wrong, but I think you'd do it like this:

Get Squid (proxy, there's a guide on this site how to install/set it up), and have your XP boxes connect to the internet through it (have your linux box accept connections from then with iptables).

Not sure of any of the specifics, seeing as how I've never done it myself. happy.gif

Here are some older threads that might help (and hey, you can always bring them alive again, *laughs*)
The easiest thing to do is to use the script here:

IP Masq 2.4 stronger

You should be able to just copy and paste the script rc.firewall-2.4-stronger into gedit and save it as /etc/rc.d/rc.firewall


make this (in the firewall script):


look like this:


Next, plug in the eth0 to the external - internet ... use DHCP for the eth0 setting in redhat-config-network

Plug in eth1 to the internel network hub .... If your internal network is 192.168.1.x you are set ... if it is something else (like 192.168.0.x), you will need to change the line (in /etc/rc.d/rc.firewall):


save /etc/rc.d/rc.firewall

Set eth1 ip addess statically via redhat-config-network to the IP you want ... in my example (subnet mask ... DO NOT SET A DEFAULT GATEWAY FOR ETH1.

INTNET is the internal network ... INTIP is the internal IP address for eth1.

Next, make /etc/rc.d/rc.firewall executable like this:

chmod 755 /etc/rc.d/rc.firewall

Then turn off iptables with this command:

/etc/init.d/iptables stop

then make iptables not start on startup ....

chkconfig --del iptables

then run /etc/rc.d/rc.firewall .... with this at the command line:


Set your XP machines to have their default gateway be the value you assigned to eth1 ... in my example ... all the XP machines would need to have IP Addresses on the 192.168.0.x network (ie to and their default gateway would be

If everything works, make /etc/rc.d/rc.firewall start on startup by editing the file:


and adding the line:


to the top of the file....

(all commands should be done in a terminal window as root).
And if you want something even easier, download and install IPKungFu, edit your /etc/ipkungfu/ipkungfu.conf to open or close your externel ports (the defaults should be fine with ssh open), and then run ipkungfu.

Of course, you should probably read the README file first smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.