Super User is a question and answer site for computer enthusiasts and power users. 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 workstation that runs Windows 7 as the host, and Ubuntu Server 12.04 in VMware on a bridged network. Both have their own static public IP address.

However, I only have one hostname to work with, so I'm trying to access them both with a single hostname: I think it would be best to give the hostname to the Ubuntu VM, since I only need one port open on the Windows machine, which is for RDP.

I've tried setting up iptables to forward connections on port 3389 to the Windows machine, but only with limited success. The connection goes through, but quickly drops and struggles to re-establish. I even have an SSH window open to the Ubuntu machine at the same time, and it severely lags when I attempt to log in over RDP.

Yes, I could simply use the Windows machine's external IP address to access it, but this is more for the coolness factor and learning purposes, as I am not too experienced with iptables yet. Here are my rules: ( is the Windows IP address)

iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to-destination
iptables -t nat -A POSTROUTING -j MASQUERADE
sysctl net.ipv4.ip_forward=1

My guess is that I could have incorrectly used NAT, since both have their own public IP and NAT may not be necessary. That, or it could be that I'm overflowing something with a potential infinite loop.

Any help is greatly appreciated!

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.