Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a number of services that I'd like to run on unprivileged ports and use iptables to map standard privileged ports to the unprivileged ones (e.g. 80->8080).

I've been reading the iptables docs from and various tutorials and forums and every example I see translates the IP address in addition to forwarding the port (e.g. ->

So my question is, I think, fairly simple. Is it possible to do port forwarding without IP address translation? So the iptables command might look something like this:

iptables -A PREROUTING -t nat -p tcp -d --dport 80 -j DNAT --to

If it is possible, is the above command correct (assuming an appropriate FORWARD rule accepts the connection)?


share|improve this question
up vote 1 down vote accepted

Yes, your command is correct. The command presented by Arenstar is only valid for redirecting the traffic to localhost (

For more info, see man iptables. Look at REDIRECT paragraph.

share|improve this answer
Thanks Khaled. Unfortunately I couldn't get iptables to do what I wanted, but I'll explore that further. I just wanted to verify that what I was trying to do was at least possible. – Chad Nov 8 '10 at 15:44

Your Answer


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.