Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
2  
It my be easier/better just to change your webserver config. Do you use apache? –  Antonius Bloch Feb 4 '11 at 17:40

1 Answer 1

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.

share|improve this answer
    
what about POSTROUTING and FORWARD chains ? its not true what You have wrote... –  Dlugi Sep 4 '12 at 10:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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