Iptables linux and dsl modems with linux?
Question: this is my current setup at home: DSL modem (has linux) -> linux router -> internal network.
I want to do 2 things:
a) dmz the linux router so everything is redirected to it (except 2 ports to admin de modem)
b) be able to host various services from my internal network ( be it: http,ftp, games, streams, etc) to the internet
i've been killing myself trying to do this with tons of differetne iptables combinations but not success
anyone out there that can help?
thanks in advance to all the help!
Answer:
B) An example for http :
I assume that you have two ethernet cards in linux router,
eth0 connects to internal network and eth1 connects to DSL
modem, and assume that there is a web server on internal
network with this ip 192.168.1.10
here is your iptables command:
# iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.10:80
ps: if you have firewall in linux router you have to open port 80 in both ethernet cards.
A) you said "everything is redirected to it"?? what is that mean? everything? if you describe source and destination of packect you want to redirect, maybe i can help you :">
Are you trying to configure iptables manually from the command line?
I strongly suggest you download FireWall Builder from www.fwbuilder.org.
It will give you a GUI for configuring your firewall and generate an automatic script with the correct iptables commands in it
iptables rules are hard to configure manually and this GUI is very easy to use and will simplify your task
More Questions & Answers...