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.
For anyone looking to do this, take a look at this tutorial
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.
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.
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.
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).
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.
- Discover your IP, I guess you already have it. (and your default gateway, what is the router port when there is no proxy)
- make sure that your Pi has an static IP (exact instructions will depend on your SO) -->example here
- 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)
- 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
Having made a free account with VNC I am now able to connect securely to my Pi from anywhere, over the internet:
I followed these instructions:
see also here:
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
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.
You can use also other technologies, without opening ports on your router at all. I list some of them: