3

I set up VNC server thanks to this tutorial but I realized that I can access to my r-pi only on the same network. So, I would like know how to access my r-pi while I am on another network and how to set a fixed IP for each r-pi I wish to monitor.

  • @all: thank you for your answers. I wish to have more r-pi to monitor and I thought to set a different fixed IP for each r-pi. Having said that, are still valid your solutions? – bit Feb 13 '14 at 12:10
3

For anyone looking to do this, take a look at this tutorial

How to Control a Raspberry Pi Remotely From Anywhere In the World

You basically install VNC Viewer on both machines and configure cloud sign in. This allows you to remote into your pi without having to enable port forwarding on your router. Additionally, you can access your pi from mobile devices since they have mobile apps as well.

2

This isnt a pi specific problem, but all pcs.

First of all, you have to own a valid IP address. If so, you can use port redirection to your pi.

If you have dynamic IP, you have to use some tool like no-ip.org to update your ip to a domain name, like yourdns.no-ip.org. Once you have one PC doing that, you could redirect one port to each pi, like yourdns.no-ip.org:9001, yourdns.no-ip.org:9002.

Again, it is not a pi specific problem, so may be you could search for dynamic DNS name and modem port forwarding to do what you want.

  • 1
    Why port 9001, and not 5901? – IgorGanapolsky Oct 9 '16 at 23:28
  • 1
    The port numbers was just an example, you can make them whatever you like. – danielbathke Nov 7 '16 at 3:21
2

You need to configure port forwarding on your internet router. I believe the default TightVNC one is 5901, though your config may be different. If you are unsure on what port forwarding is, see this http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router.

Then you can use your external IP http://icanhazip.com and the port to connect to your VNC server.

2

There are literally many ways for doing this for which what you need are static IP address and port forwarding on the router. Your condition may vary depending on what you have access to and on what side (client or server).

In my case, I had no access to the router and no static IP on both sides. But, I had access to a third-party server which I used for the connection. In short, here's what I used to do: VNC using third party server

I used ssh tunnel for port forwarding and a third computer with a static IP to solve dynamic IP related problem. If you have access to an ssh server, you can follow the procedure from this link.

1
  1. Discover your IP, I guess you already have it. (and your default gateway, what is the router port when there is no proxy)
  2. make sure that your Pi has an static IP (exact instructions will depend on your SO) -->example here
  3. Enter your router (in the browser enter you default gateway (something like 192.168.1.1) and make it forward your VNC port to your raspberry IP (usually port 5901) (in a section called NAT, enter a new entry to the table saying that port 5901 , both UDP and TCP will be sent to your local raspi IP (you know, 192.168.x.x)
  4. Follow this tutorial to get a fix domain name to access your raspi from the internet, and have your raspi updating his own public address when needed --> tutorial
  • I am using Google Synthetic domains, and am able to SSH into my RaspPi outside my house that way. However, I cannot connect to VNC that way... – IgorGanapolsky Oct 9 '16 at 23:24
1

Having made a free account with VNC I am now able to connect securely to my Pi from anywhere, over the internet:

https://www.realvnc.com/en/raspberrypi/

I followed these instructions:

https://www.realvnc.com/en/docs/raspberry-pi.html#raspberry-pi-setup

see also here:

https://www.raspberrypi.org/blog/get-back-to-my-pi-from-anywhere-with-vnc-connect/

0

I realize this post is old, but thought I might have some useful info.

To connect to my pis via VNC on different networks and without port forwarding I use the website: https://www.remot3.it/web/index.html

You can make a free account, then, in the terminal of the pi, you can run the commands:

sudo apt-get update

sudo apt-get install connectd

sudo connectd

Then follow the steps in the installer and you can view and control all your devices (as long as they have a route to the internet, or even cellular) from anywhere. You can also follow this video once you have an account/the installer: https://www.youtube.com/watch?v=sHaY4EBQowQ

Full disclosure: I'm actually an intern at remote.it this summer, but I thought it might be useful for you.

0

You can use also other technologies, without opening ports on your router at all. I list some of them:

  • noVnc
  • Guacomole
  • ngrok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.