4 Replies - 3140 Views - Last Post: 16 June 2011 - 05:31 PM

#1 Codebug  Icon User is offline

  • D.I.C Head

Reputation: 31
  • View blog
  • Posts: 244
  • Joined: 11-October 09

accessing a lan computer from the internet(remote desktop)

Posted 16 June 2011 - 04:38 PM

I have been thinking about this for a while, but I haven't been able to come up with a solid answer. Say you have a home network(LAN) consisting of multiple computers behind a common router(wired, wireless, w/e). On the LAN, each computer has its own distinct local ip address. However, to the outside world(internet), your home network is represented by a single, common ip address via the router.

My question is, how do remote desktop programs get through the router and determine which computer to connect to? For example, say there are two computers on a home network, Computer A and Computer B. There is remote desktop software installed on both. There is also remote desktop software installed on a PC outside of this home network. The home network ip is 68.172.54.2. Computer A's ip is 192.168.1.1 and Computer B's ip is 192.168.1.2. If you want to connect to Computer A from the other PC across the internet, how does the outside PC even see Computer A since the whole home network is represented by a single outside ip address?

I mean, I guess you could specify the outside ip address to the program, but that would only get you to the front door. If you also specify the local ip address of Computer A, you run the risk of the ip changing if dynamic ip addresses are being used.

So, how does all of this work?

Is This A Good Question/Topic? 0
  • +

Replies To: accessing a lan computer from the internet(remote desktop)

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4401
  • View blog
  • Posts: 12,257
  • Joined: 18-April 07

Re: accessing a lan computer from the internet(remote desktop)

Posted 16 June 2011 - 04:51 PM

One way this is accomplished is using port forwarding on the router. You open a port on the router that outside applications connect to and then all traffic you send to the router is accepted by the router and passed to the internal computer. :)
Was This Post Helpful? 1
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: accessing a lan computer from the internet(remote desktop)

Posted 16 June 2011 - 04:53 PM

One way to connect directly to a computer behind a router is to configure the router to forward any data that goes through a specified port directly to the specified computer. This is known as: Port Forwarding.

So if you want computer A to serve as a HTTP server, you configure the router to forward all data that comes in on port 80 to the local address 192.168.1.1. Then all you have to do to connect to the HTTP server on computer A, is connect to 68.172.54.2:80, and the router will route that connection directly to 192.168.1.1:80.
Was This Post Helpful? 1
  • +
  • -

#4 Codebug  Icon User is offline

  • D.I.C Head

Reputation: 31
  • View blog
  • Posts: 244
  • Joined: 11-October 09

Re: accessing a lan computer from the internet(remote desktop)

Posted 16 June 2011 - 05:01 PM

Excellent information guys! That makes alot more sense. Another question - if you are using dynamic ip addressing as in the above example, how do you handle the situations where the ip addresses change on the local computers as happens from time to time? If you set up port forwarding to a specific computer and its ip address changes dynamically, the port forwarding will no longer work correctly.

How do you get around this?
Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: accessing a lan computer from the internet(remote desktop)

Posted 16 June 2011 - 05:31 PM

Routers identify devices by their MAC addresses, not their IP addresses, and that is usually mapped to a device name. Kind of like domain names on the internet, the router keeps a record of devices and their names so the IP for a device can be queried by it's name.

The router will (or rather: should) forward a port to the specified device, even if the IP address is not static.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1