Connecting with VNC
July 4, 2005 11:42 PM   Subscribe

Need help getting VNC to work.

I'd like to use VNC between three computers. I have two stationary PCs at two different locations connected to the internet via different broadband providers with routers. I also have a laptop which will be used at both locations (connecting to the internet wirelessly via the aforementioned routers).

The laptop can only communicate (using VNC) with the PC it happens to be sharing the LAN with and not with the one far away on a different LAN . This (I think) is due to the cable ISP setting IP addresses dynamically, and my router not being configured to allow VNC service.

How do I address the above two issues so that all three computers can communicate using VNC (in server and viewer modes)? I understand that to configure the routers I need to go to the router login site and add VNC as a service. But is this something I must do _from each computer_? And since the laptop will be used at both locations (each using different brand routers, must I do this on the laptop twice (once for each router)? Also, when I specify the service and port at the router site, it asks me for an ip address--will it work if i simply indicate the IP address assigned at that time? It seems not. It seems I need to somehow get a static IP address. I'd appreciate any input on whether I'm right about that and if so, on where and how to get a static IP address. Thanks.
posted by crack to Computers & Internet (3 answers total) 2 users marked this as a favorite
OK, you have three issues here. First, you need to be able to find the external IP address of each of your routers (I'm assuming you only get one IP address for each network, and are using NAT on the routers, i.e. you are sharing the Internet connection among several computers, each with local 192.168.x.x addresses). To do this what you want is a dynamic DNS service. What this does is allow you to assign a hostname to an IP address that changes regularly. You run a dynamic DNS update client on one of the PCs on each network (some routers also have this built in) and when it sees the external IP address has changed, it updates the DNS server that hosts the hostname record for that network. The most popular dynamic DNS service is

Second, your laptop is being assigned a local (192.168.0.x) dynamic IP address by one or the other of the routers and this IP address changes each time. The easiest way around this is to set up a DHCP server that can be configured to give a particular MAC address (e.g. the MAC address of your laptop) the same reserved DHCP address each time. The machine will continue to ask for a dynamic address but the DHCP server will recognize it and assign it the same one, making it essentially static. Some routers (Netgear, DLink) have this capability in their DHCP servers. You could also set up static IP configurations on the laptop and switch from one to the other manually when connecting, but this gets to be a pain pretty quickly -- it's better to do it at the router if you can, because it will require less fiddling on the client machine.

Once all of your machines have an internal IP address that can be relied upon, you can set up port forwarding. At times, there will be more than one machine on one or the other network that you need to have accessible via VNC. To do this you will need to assign different port numbers to the VNC servers on each machine, then set up port forwarding on your router so that the proper ports go to the correct machines. For example, port 5900 (the default VNC port) might go to one machine and port 5901 might go to another. When connecting with a VNC client you will then specify the port number (or the display number -- VNC adds the display number to 5900 to get the port, so they would be numbered 0, 1, etc.) in addition to the hostname of the network you are connecting to.
posted by kindall at 12:10 AM on July 5, 2005

Thanks Kindall! My research had left a few gaps which your answer fills.
posted by crack at 9:21 AM on July 5, 2005

Just adding my own experiences here in case they're useful:

Work has a very restrictive firewall. When they finally choked off some web sites that I *had* to have access to, I decided to see if I could set up a VNC server on my home machine and remotely connect to it from work.

Home is on a cable ISP that restricts lots of "service ports" in the hope of frustrating their customers into paying more for "business accounts".

Port 80 and 8080 outbound from home were blocked by the cable ISP.

Almost all "non-standard" ports (the 5900 and such that VNC likes to default to) were blocked at the work firewall.

I finally happened upon the magic port that passed both the cable ISP and the work firewall:

Port 443 - SSL

My home VNC server looks for connections on port 443, and when I connect from work, I type in my home IP:443 (ie - XXX.XXX.XXX.XXX:443) and it connects right up. Heaven!
posted by de void at 10:28 AM on July 5, 2005

« Older Super-Fast Pecs?   |   How to lead a cult Newer »
This thread is closed to new comments.