Help - Search - Members - Calendar
Full Version: Using Linux As A Gateway
Linuxhelp > Support > Technical Support
mrm
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
Termina
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*)

http://www.linuxhelp.ca/forums/index.php?a...t=2912&hl=squid

http://www.linuxhelp.ca/forums/index.php?a...t=3046&hl=squid
hughesjr
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

then:

make this (in the firewall script):

#IPTABLES=/sbin/iptables
IPTABLES=/usr/local/sbin/iptables


look like this:

IPTABLES=/sbin/iptables
#IPTABLES=/usr/local/sbin/iptables


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):

INTNET="192.168.0.0/24"
INTIP="192.168.0.1/32"


save /etc/rc.d/rc.firewall

Set eth1 ip addess statically via redhat-config-network to the IP you want ... in my example 192.168.0.1 (subnet mask 255.255.255.0) ... 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:

/etc/rc.d/rc.firewall

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

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

/etc/rc.d/rc.local

and adding the line:

/etc/rc.d/rc.firewall

to the top of the file....

(all commands should be done in a terminal window as root).
Corey
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-2017 Invision Power Services, Inc.