Using VNC to Control PC behind NAT

22,403

Solution 1

If you are willing/able to use an alternative solution, I suggest teamviewer.

It's free for non commercial usage. Usage is really simple.

  1. Download/Install the software
  2. Start the Client, and give the other user the teamviewer ID and password ( both are visible on the main screen)

Other user can use given user/password combo to remotely connect and control the PC.

Solution 2

You could connect through a reverse SSH tunnel. Configure your router to forward some port (say 2222/tcp) to a local SSH server on your side. Have the remote user establish a reverse SSH tunnel from the host running the VNC server to your public IP address (a.b.c.d):

plink -R 5901:127.0.0.1:5901 -P 2222 -L USER a.b.c.d

Once the tunnel is established, you can connect with the VNC client your SSH server's IP address, e.g.

vncviewer 192.168.23.42:1

or (when the SSH server is running on your workstation

vncviewer 127.0.0.1:1

The NatToNat add-on uses a similar (though slightly different) approach.

Solution 3

When try to help my 80 year old Dad remotely I have used a VPN to avoid all the NAT/Firewall etc issues. I used Logmein Hamachi to create a virtual network then got him to install Hamachi and join the network with the user name/password. Simple and hopefully secure connectivity.

I then got him to install UltraVNC Server whilst I installed the viewer. Connect using the VPN IP address - voila. Any remote control software will then run over the VPN, it doesn't have to be VNC.

Solution 4

zero tier is another alternative to hamachi which is open source. You can use it to easily get the computer onto a shared vpn which you can then remote desktop or ssh into from there.

Share:
22,403

Related videos on Youtube

Robert S. Barnes
Author by

Robert S. Barnes

I'm a self taught programmer whose taken a break to go back to school and study Software Engineering. Currently, my main area's of interest are network programming and application level protocols, object oriented design and methodologies like Agile and TDD.

Updated on September 18, 2022

Comments

  • Robert S. Barnes
    Robert S. Barnes over 1 year

    I need to use VNC to control a computer behind a NAT. I have no access to the remote router, but I can have the person sitting in front of the computer follow very simple instructions. I'm also behind a NAT, but I can set up port forwarding if needed. The connection is Win to Win and I was thinking of using UltraVNC. I have no previous experience with VNC. So far from what I've read I've got two ideas:

    1. Setup port forwarding on my end and have client connect to my computer running the VNC viewer.
    2. Try using the UltraVNC NatToNat add-on.

    Is number 1 possible and realistic? Any kind of documentation for it from the clients pov?

    How does #2 work? Are there any public UltraVNC Nat Helper servers?

    Any other ideas? This is a one off thing so I don't want to get to involved or complicated.

  • Robert S. Barnes
    Robert S. Barnes over 11 years
    I'm looking for a reasonably simple Win To Win solution.
  • LawrenceC
    LawrenceC over 11 years
    I've used this many times for quick remote sessions.
  • Robert S. Barnes
    Robert S. Barnes over 11 years
    Awesome, this look like exactly what I'm looking for.
  • Robert S. Barnes
    Robert S. Barnes over 11 years
    Sounds interesting and cool, but I think the teamviewer solution is probably more suited to my situation - I'm also helping out my Dad :-)
  • mehov
    mehov almost 6 years
    To whoever finds this: here's some more detailed information blog.trackets.com/2014/05/17/… (scroll down to Remote port forwarding and make sure to set GatewayPorts yes otherwise the server's end will bind to 127.0.0.1 and 0.0.0.0 or \* won't help)
  • sdbbs
    sdbbs about 5 years
    Except you might not be able to see if you're installing "personal" or "commercial" version, and then after 30 days TeamViewer might determine you're using it commercially, and then you will have to pay.
  • jkschin
    jkschin about 4 years
    maybe that solves the particular user's problem, but it is not an answer to the question, hence - bad answer to (some) people who looking for solution to the exact phrased question.