Need help fast with iptables
I have a server which has 3 nic's in it with the following configuration:
eth2 192.168.1.2 to router 192.168.1.1
eth1 192.168.2.1 vlan 10
eth0 192.168.3.1 vlan 20
the server can get the internet no problems, but i am trying to forward the traffic from both eth1 ,eth0 to eth2 and back again etc but i have tried a few peoples iptables scripts and they dont seem to work eg.
edit: ip forwarding is on to, and eth1 and eth0 have the gateway and dns of 192.168.1.1 router ip
$IPT -P OUTPUT ACCEPT
$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -t nat -A POSTROUTING -o eth2 -j MASQUERADE
$IPT -A FORWARD -i eth2 -o eth1 -m state ---state RELATED,ESTABLISHED -f ACCEPT
$IPT -A FORWARD -i eth1 -o eth2 -j ACCEPT
$IPT -A FORWARD -i eth2 -o eth0 -m state ---state RELATED,ESTABLISHED -f ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -j ACCEPT
Can anyone tell me if i have done something wrong its doing my head in.