Click to See Complete Forum and Search --> : Ip forwarding and gatewaying
Gday,
Wondering if anyone has any info on using a linux box as a gateway...
I have two subnets... 90.0.0.0 and 90.0.1.0.
Eth0 is on 90.0.1.0
Eth1 is on 90.0.0.0
I have tried to enable ipforwarding by using the echo 1 /proc/sys/net/ipv4/ip_forward command.
I assume this is a switch to turn it on and off.
Not sure where to go from there...
Cya round
Jinx
Ardith
11-09-2000, 05:02 PM
In order to set up a gateway, you'll need some form of IP masquerading. I use ipchains... Umm... I got my cousin to send me a simple setup. Unfortunately, I'm not on my computer right now, and don't have it with me. I'll try and get it for you tomorrow. Anyway, it does use ipchain but it might use something else too. As for IP forwarding, there is a flag in /etc/sysconfig/network (I'm not sure how different it is for two network cards) to turn IP forwarding on. That's what I know, and it's really pretty easy to set up once you know what you want.
Somebody else can probably tell you more exactly what you want.
Ardith
11-11-2000, 05:09 PM
Alright, here's a short bash script to set up a firewall.
# Load IP Masquerading modules
/sbin/modprobe ip_masq_ftp
/sbin/modprobe ip_masq_irc
# Set kernel IP masquerading parameters
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
# Setup firewall policies
/sbin/ipchains -M -S 7200 10 160
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.1.0/24 -j MASQ
Of course, you'll want to replace 192.168.1.0/24 with your range of ip addresses for your clients.
Also, this isn't extremely safe, but it should work for now. You might want to look up the docs for ipchains and change the settings to what you want. Hope this helps.