Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
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


Posted 08-19-2008 5:57 PM by Billy McCafferty

[Advertisement]

Comments

Exposing Multiple Computers via Remote Desktop over a Single IP … wrote Exposing Multiple Computers via Remote Desktop over a Single IP &#8230;
on 08-19-2008 10:45 PM

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

flaub wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-19-2008 11:56 PM

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)

Billy McCafferty wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-20-2008 12:03 AM

Great tip Frank...thanks!

Kevin Jensen wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-20-2008 11:00 AM

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.

Billy McCafferty wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-20-2008 11:03 AM

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. ;)

mendicant wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-20-2008 3:42 PM

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.

betteridea wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-21-2008 3:36 PM

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...

betteridea wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 08-21-2008 3:36 PM

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...

petersatish wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 09-07-2008 1:49 PM

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/

Soapstop wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-08-2008 4:10 PM

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

Billy McCafferty wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-11-2008 11:28 PM

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

Ken Buscher wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-12-2008 10:49 PM

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?

Billy McCafferty wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-13-2008 1:18 AM

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

petersatish wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-13-2008 6:28 AM

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

soapstop wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-13-2008 11:08 PM

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.

Soapstop wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-13-2008 11:24 PM

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

Soapstop wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-13-2008 11:30 PM

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.

Ken Buscher wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-16-2008 11:53 AM

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.

Ken Buscher wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-16-2008 12:06 PM

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?

Soapstop wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-17-2008 9:52 AM

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

Ken Buscher wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 11-18-2008 5:31 PM

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

LA computer services wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 01-02-2009 1:36 PM

I am not sure exactly what the solution is.  Do you have to change the default registry setting on each computer or not?

Dan R wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 02-03-2009 12:22 PM

It's more likely that the netgear router is old and doesn't have user configurable port forwarding. I use a Netgear DG834PN and I can use any of my PC's. I wouldn't just go out and buy another router when 1, It may just require a software upgrade or 2, The terminology may be different.

For those interested I also use Windows Server 2003 L2TP VPN, this was really easy to configure and always works. The only thing that fails every now and then is the router :(

Just my 2 cents

Sressed wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 02-20-2009 8:35 AM

I have a computer at work that connects to a domain. I used the Microsoft Remote Desktop tool to connect to the server from my home computer, using the servers external IP address, then connect to my machine from the server using the internal IP address. how do I connect directly to my work machine? Does it have an external IP? Where do I find this? Will i still connect to the server like i do at work if i use this method? Please Help

jhon wrote re: Exposing Multiple Computers via Remote Desktop over a Single IP Address
on 04-01-2009 12:35 AM

I am able o use remote desktop form my LAN

but not from outside of it.

I have poked a whole on the NAT of my router just as flaub recommends. And it is not working.

Any hint on what i might be doing wrong?

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)