Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Billy McCafferty



Exposing Multiple Computers via Remote Desktop over a Single IP Address

[Post publish note - 8/19/08:  Frank Laub has provided a tip, in the comments below, for alternatively configuring your router for port forwarding rather than setting up a new listener port for each computer.  This is exactly why I like to blog...for others to tell me an easier way to do things!]

I often have a need to remote onto one of the multiple computers on my home network from offsite but am too cheap to get more than one IP address.  Instead of getting more IP addresses (and without installing a third party tool), you can easily accommodate this by modifying the listening port, from the default of 3389, of each computer on your network.  You'll then be able to remote desktop into each of your computers via <your IP address>:<custom listening port number>.

To make this possible, take the following steps (performed on Windows Server 2003 with Windows Firewall enabled):

  1. Enable the computer to accept Remote Desktop connections
    1. Right click the My Computer icon and bring up System Properties and go to the Remote tab
    2. Check the Enable Remote Desktop option
    3. Select users which will have Remote Desktop access to the computer
  2. Change the listening port of the computer you'd like to remote desktop onto (http://support.microsoft.com/default.aspx/kb/306759):
    1. Start Registry Editor
    2. Locate and then click the following registry subkey:
      HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
    3. On the Edit menu, click Modify, and then click Decimal
    4. Type the new port number, and then click OK
    5. Restart the computer
  3. Expose the new port through the Windows Firewall
    1. Open Network Connections
    2. Open the properties of the Local Area Connection and go to the Advanced tab
    3. Click the Windows Firewall Settings button and go to the Exceptions tab
    4. Click Add Port... and provide the following:
      • Name = "Remote Desktop (<custom listening port>)"  (What you name this is arbitrary, but this helps to identify it.)
      • Port Number = <custom listening port>
      • TCP should remain checked
      • Change Scope should be set to Any Computer (if you want to remote desktop over the internet), My Network (if you only want to be able to remote desktop from internally - but then there's no point in changing the listening port), or Custom List
  4. If you are using a hardware firewall as well, you'll also want to poke a hole in it for the custom listening port and have it redirect traffic on that port to the respective computer.

And that should do it!

Billy McCafferty



Comments

Exposing Multiple Computers via Remote Desktop over a Single IP … said:

Pingback from  Exposing Multiple Computers via Remote Desktop over a Single IP &#8230;

# August 19, 2008 10:45 PM

flaub said:

Well, you could make it a whole lot easier on yourself and just setup port forwarding on your home router like this:

external port -> internal IP -> local port

3889 -> 192.168.0.50 -> 3889

4889 -> 192.168.0.51 -> 3889

5889 -> 192.168.0.52 -> 3889

In this case, you now have one pass-thru and two redirected ports. This means you don't need to modify anything on each host, only the network configuration changes. Note you can reach each rdp session remotely using your public IP address and one of the external ports. Say your public IP is 1.2.3.4, then you do this:

1.2.3.4:3889 takes you to host 1 (192.168.0.50)

1.2.3.4:4889 takes you to host 2 (192.168.0.51)

1.2.3.4:5889 takes you to host 3 (192.168.0.52)

# August 19, 2008 11:56 PM

Billy McCafferty said:

Great tip Frank...thanks!

# August 20, 2008 12:03 AM

Kevin Jensen said:

Even better would be to hack your router to dd-wrt and configure VPN.  Then you can VPN into your network and RDP into any pc you want by internal IP.

# August 20, 2008 11:00 AM

Billy McCafferty said:

Yeah, that's a bit beyond my skill level - I usually get pretty impressed with myself if I can enable file sharing between two computers. ;)

# August 20, 2008 11:03 AM

mendicant said:

I would have done exactly what flaub mentioned, except that I have a linux machine running at my place as well. The only port I have open is 22 for ssh. I ssh in with tunnels set up to each PC, kind of like what flaub said:

localhost:9000 -> 192.168.0.50:3389

localhost:9001 -> 192.168.0.51:3389

etc.

I guess I'm just using the ssh as a kind of VPN tunnel.

# August 20, 2008 3:42 PM

betteridea said:

why not try out the small, free software called gbridge.

it allow you to access RDP to multiple machines behind the NAT, and it is easy to use.

Gbridge is an extension to Google's Gtalk network service. It

automatically forms a VPN between user's multiple computers if logged

in under same Gtalk user account. The VPN can also be extended to

Gtalk friends based on invitation. Gbridge also has several built-in

features which integrates popular functions such as folder

synchronization, remote desktop share (VNC), automatic backup, live

browsing, chat, etc.

en.wikipedia.org/.../Gbridge

www.download.com/.../3000-2196_4-10877073.html...

# August 21, 2008 3:36 PM

betteridea said:

why not try out the small, free software called gbridge.

it allow you to access RDP to multiple machines behind the NAT, and it is easy to use.

Gbridge is an extension to Google's Gtalk network service. It

automatically forms a VPN between user's multiple computers if logged

in under same Gtalk user account. The VPN can also be extended to

Gtalk friends based on invitation. Gbridge also has several built-in

features which integrates popular functions such as folder

synchronization, remote desktop share (VNC), automatic backup, live

browsing, chat, etc.

en.wikipedia.org/.../Gbridge

www.download.com/.../3000-2196_4-10877073.html...

# August 21, 2008 3:36 PM

petersatish said:

Microsoft win xp & vista has support for peer to peer connectivity over internet even pc behind firewall using teredo service. You can check "lan on internet "which works using that:)

http://www.lanoninternet.com/

# September 7, 2008 1:49 PM

Soapstop said:

Ohh, this is going to sound like a silly question, but...I am a newbie. Business owner that now does a little "remote desktop" from home, accessing his computer at work. The computer at work is on a Lan network of 10 computers. Question: Using remote desktop, can I set up my salesmen to access their computers on the lan (providing, of course they have xp pro, or vista business on their work computers) using the example given by "Flaub" and will this allow access at the same time?. I mean, can both my salespeople access their business computers using Flaub's example simultaneously?

Thanks in advance,

Robin

# November 8, 2008 4:10 PM

Billy McCafferty said:

There's only one way to find out Soapstop! ;)  (That means I'm not sure but I don't think it's a problem.)

# November 11, 2008 11:28 PM

Ken Buscher said:

I have a client who needs to access 4 different computers using remote desktop.  I have changed the listening port on 3 of the systems, opened a hole in the firewall for the port and established to port forwarding in the Netgear router.  The only one that works is the one that still useds the original 3389.  I know that I am not the sharpest knife in the drawer, but what am I missing?

# November 12, 2008 10:49 PM

Billy McCafferty said:

I hope it's not too silly of me to ask if you modified the registry on each and restarted the computers?

# November 13, 2008 1:18 AM

petersatish said:

Any pc Open start->run->cmd

telnet <publicipaddress> <portnumber>

If its says conenction established port is open otherwise there is problem with portforwarding..Use tcpview software  from microsoft to check actually what's happening to the TCP connection..

technet.microsoft.com/.../bb897437.aspx

# November 13, 2008 6:28 AM

soapstop said:

Yahoo!!! (The expression, not the site) Flaub was bang on! The suggestion of the external port redirection worked flawlessly. When accessing the router using the i.p. address (my router is a d-link) I think it's called public port and private port instead of "external port" and "internal port". Just follow flaub's advice.May I say, once you have set up the router port forwarding, please remember to read the rest of flaub's advice and carefully type in the colon then the external port info so that you are directed to the correct computer. Missed that little bit (ok, so I forgot that little bit) which lead me to believe it wasn't going to work for me. This all lead to a wasted 15 minutes going back and checking all my port forwarding info to make sure I got it straight.

Anyway, long story even longer, I can now access any computer running  xp pro or vista business or higher at work from any computer I want, and can have these connections happening simultaneously. I am in remote desktop heaven ....or at least as close as this non tech guy is ever going to get.

Thanks for everyone's help.

# November 13, 2008 11:08 PM

Soapstop said:

In response to Ken Buscher (and flushed with success using Flaub's suggestion) my question for Ken: If you can simply re-direct an external port on the router to the internal i.p.address of the computer, and still be able to use 3389 for each of the computers that you want to access. Remote desktop wants to use 3389, and it's easy to let it use the 3389 port on each computer. By leaving it, you don't have to change the registry of each computer.  Less muss, less fuss. Not that I'm qualified to give advice.

Soapstop

# November 13, 2008 11:24 PM

Soapstop said:

Sorry, must  learn to proof read before posting:

The question for Ken was supposed to say: If you can simply re-direct an external port on the router to the internal i.p.address of the computer, and still be able to use 3389 for each of the computers that you want to access, why would you want to go to all that trouble of changing the listening port? Sorry, my bad, my very tech-bad.

# November 13, 2008 11:30 PM

Ken Buscher said:

In response to Soapstop: I have not been able to find where I can re-direct the ports as in Flaub's description.  I am using a NetGear router and wonder if that is the problem.

# November 16, 2008 11:53 AM

Ken Buscher said:

Using Billy's method, I have triple checked the registry and firewall on each system as well as the port forwarding on the router.  I have also made sure that the port number is entered preceded by a colon.  I have also tried to setup the same situation on my office system with no luck.  The one thing in common between the two offices is a NetGear brand router.  Do I need to switch to a Linksys router?

# November 16, 2008 12:06 PM

Soapstop said:

In response to Ken Buscher: Ken, copy and paste the following location in your browser.  www.portforward.com/.../routerindex.htm

This is a listing of routers. See if under the netgear heading it has your number of router. Click on it, and follow the directions. Click on home of the same site and follow the links to any of the tutorials as well.

Remember that this port forwarding issue is only for the host computers router. Nothing needs to be setup on the client router (sorry, I am not trying to suggest that you wouldn't know that, just stating obvious things that some people have missed, no names mentioned, ahem, maybe me at one time, ahem.)

Soapstop

# November 17, 2008 9:52 AM

Ken Buscher said:

FYI.  Replaced the NetGear router with a Linksys and Flaub's technique worked perfectly.  Thanks for all the suggestions and comments

# November 18, 2008 5:31 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

Our Sponsors

Red-Gate!