LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Need help with iptables... (https://www.linuxquestions.org/questions/linux-networking-3/need-help-with-iptables-381242/)

lamiczka 11-08-2005 05:06 PM

Need help with iptables...
 
:newbie:

I got iptables on my router. In my LAN I got a webserver. I need to forward requests to it, but cant figure it out.... anyone can help me??

iptables -t nat -A PREROUTING -p tcp --source-port 80 -s 62.240.165.131 -j DNAT --to-destination 192.168.1.10:80
iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 80 -d 192.168.1.10 -j ACCEPT

what am I doing wrong?

Brian1 11-08-2005 06:36 PM

This should be what you are after.
iptables -A ALLOW_PORTS -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -d 62.240.165.131 --dport 80 -j DNAT --to-destination 192.168.1.10:80

Brian1

lamiczka 11-09-2005 08:11 AM

Quote:

Originally posted by Brian1
This should be what you are after.
iptables -A ALLOW_PORTS -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -d 62.240.165.131 --dport 80 -j DNAT --to-destination 192.168.1.10:80

Brian1

Does not work either...... :cry: :cry: :cry:

I really dont know what to do now :cry:

Brian1 11-09-2005 05:53 PM

Post your entire iptables script.

Brian1


All times are GMT -5. The time now is 02:07 AM.