I work with Debian (Linux) and try to change the destination of incoming packets from port 80. Here's the setup: I have my firewall that has two addresses and a web server that has two addresses.
Example:
FireWall
Internal adress: 10.3.3.13
External adresss: 206.167.200.213
Web Server
Internal adress: 10.3.3.6
External adress: 206.167.200.206
I need to redirect incoming connection from port 80 on my firewall to port 80 on the web server.
Here's the command line I'm using in Debian:
iptables -t nat -A PREROUTING -i eth0 -p tcp -d 10.3.3.6 --dport 80 -j DNAT --to 10.3.3.6
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT
Why doesn't this command work? When I enter the external address of my firewall, the redirect doesn't work and I end up on the default web page of my firewall.
-dparameter wrong. – ninjalj Nov 1 '11 at 16:57