Windows – What Iptables rules need I to forward a windows remote desktop connection

iptablesremote desktopUbuntuwindows

I have this situation:

network mask. 255.255.255.0

  • router/gateway: Ubuntu server (only command line, no gui) with internal lan ip 192.168.0.2 and a dynamic dns on the external ip

  • Windows pc on 192.168.0.1 with RDP (remote desktop connection) enabled on 3389

I want to forward the RDP service on the external address: how can i do that?

What are the iptables rules I need to connect to my Windows pc from the outside world?

Best Answer

So just giving you this rule probably won't be enough. Here's why: I'm not sure if (a) it'll work right (haven't tested it) and (b) if it does work it'll do more than work - it'll probably forward RDP packets to ANY machines in your network. The dilemma is, how to get the right IP address for the -d nnn.nnn.nnn.nnn/nnn argument. So... buyer beware; if 0/0 works it'll probably work to ALL machines behind your router.

Anyways, here you go:

iptables -A FORWARD -p tcp -s 0/0 -d 0/0 --destination-port 3389 -j ACCEPT

Here's some good reading on iptables: http://oceanpark.com/notes/firewall_example.html

Regards,
-pbr

Related Question