|
IP tables -- re route a port
Hi,
I'm looking to re-route connections coming into port 80, to actually go to 81. What I do now is:
I have two apaches. One setup on 80, one on 81. The 80 one contains a mod_rewrite condition that accepts the request, then rides the person onto the 81.
RewriteEngine On
RewriteRule (.*) h_t_t_p://%{HTTP_HOST}:81/$1
That's my code. Works fine, but... someone said I could use this instead:
iptables -t nat A PREROUTING -p tcp --dport 80 -j DNAT --to-destination webserver-ip-address:81
This is the code I was given. However, it doesn't work when I enter it. I just get "Bad arguement 'A'" when I put it in the termial. Also for destination web server IP address, what do I put, my router IP or the actual IP, and what does this do exactly?
Thanks for your time,
Dan
|