I have a web server running on my server on port 7000. I want it to be accessible on port 80. I've read that this could be easily done with iptables port forwarding. What would the correct command would be to achieve that?

E

link|improve this question

75% accept rate
2  
It my be easier/better just to change your webserver config. Do you use apache? – Antonius Bloch Feb 4 '11 at 17:40
feedback

1 Answer

up vote 3 down vote accepted

Iptables command:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 7000

Change eth0 to your external interface name.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.