McBoon
06-25-2002, 08:05 PM
I have been wrestling with iptables for about 4 months now and I still can't get it to the way I want. LInux is the firewall and windows is behind it. I can't receive or send files on many clients. I can't host games either.
Linux is also a webserver.
What I'm trying to do is have any requests to the webserver go to the webserver. If it is anything else, go to my windows computer. Basically have it so my clients / games don't know that it's going through a firewall.
I can't seem to understand iptables and it's getting really frustrating.
Any suggestions? Here's my current code.
# $INAM is internet name (eth1)
# $INET is internet IP
# $LNAM is LAN name (eth0)
# $LNET is LAN IP
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -t nat -A PREROUTING -p TCP -i $INAM -d $LNET --dport ! 80 -j DNAT --to-destination $LNET
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Linux is also a webserver.
What I'm trying to do is have any requests to the webserver go to the webserver. If it is anything else, go to my windows computer. Basically have it so my clients / games don't know that it's going through a firewall.
I can't seem to understand iptables and it's getting really frustrating.
Any suggestions? Here's my current code.
# $INAM is internet name (eth1)
# $INET is internet IP
# $LNAM is LAN name (eth0)
# $LNET is LAN IP
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -t nat -A PREROUTING -p TCP -i $INAM -d $LNET --dport ! 80 -j DNAT --to-destination $LNET
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT