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 am not very well versed in iptables, so I apologize for a bit lame question. What I need to do is to redirect port from a VM running on a private network the outside world.

VM, that is running on a server has, say, ip address I need to forward port 8080 from that VM onto servers port 8080 on interface,say eth1 that is connected to the other private network. How would I do that?

share|improve this question
up vote 0 down vote accepted

Port forwarding in common case:

iptables -t nat -I PREROUTING -p tcp --dport 8080 -j DNAT --to-destination=

But in same cases you should add some SNAT's or change routing.

Note: do not forget check FORWARD chain

share|improve this answer

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.