I want to connect my raspberry pi from outside of my home network and trying to connect from my office. I dont want to do by using port forwarding. Is there any good way to achieve this.


I use a website called weaved which allows you to connect via ssh, http, or almost any protocol for free. However, there are limitations to the session times and the remote devices. Usage with the raspberry pi is super easy assuming you are using raspbian(see their instructions on how to set it up with the raspberry pi.)


Well there are 2 solutions without using extra software.

First solution is the get your Pi to call you at the office. But you need to enable port forwarding at the office though. I am not sure if that is possible for you. You basically get your Pi to SSH to you, creating a reverse proxy so to speak.

Second solution is to get a VPS, like say digital ocean droplet. Then both your Pi and Office call the VPS (both Pi and Office PC initiate outgoing connection which then automagically opens a port in NAT for that session) This may require a bit more config on the VPS but essentially like double reverse proxying.

Otherwise, without opening a port on your router (NAT) - The router doesnt know where the packets need to go to. A bit like a firewall but dumber. When you call out the router knows where to send the replies too. If you cannot log into the router you can try doing UPNP. A home router should work fine, more commercial ones have this disabled for most ports.

You can bypass some strict firewalls by SSH'ing over port 80. Some more clever routers inspect packets to see if it is truly HTTP traffic and not some other stuff going on. Bypassing that, the only way I have done that is to have a 3G/4G connection to bypass the corporate firewall.. sneaky.. but they can't block that traffic.

  • If you have a VPS you could also set up a VPN, although if "from my office" means "using the office computer" then that's a little iffier. But if it is just your own laptop/smartphone/whatever you want to use, you put a VPN server on the VPS, have the pi configured to stay connected all the time, and use a VPN client from the whatever device. You can then connect to the pi from anywhere. – goldilocks Aug 25 '16 at 21:53

What comes to mind is a 3rd party (closed source) solution called Hamachi (see Hamachi for Linux) They have a beta version for pi/arm available. Depending on office policy you may however not be allowed to do that.

With Hamachi, both ends connect to the Hamachi server and communicate via a dedicated encrypted (private) virtual network. If I remember well, up to 5 participants can take part in each network for free.

  • This is truly the best solution available for the current scenario! My ISP doesn't allow port forwarding and Hamachi VPN has been a lifesaver for me. – Aniansh May 21 '18 at 15:46
  • Have you tried ZeroTier as an open source alternative? – Roger Jones Dec 6 '18 at 8:56

I'd recommend using a dynamic DNS service for that purpose. Just use your favorite search engine and investigate that subject, you will find tons of information and providers.

  • Hello and welcome. Please note that all Stackexchange sites share a be nice policy. Giving a user the LMGTFY might come off as somewhat unpolite. – Ghanima Aug 25 '16 at 9:27
  • Please take the tour and visit the helpcenter to see how things work here. – Ghanima Aug 25 '16 at 9:27
  • 2
    dyndns won't do anything to help the situation, and isn't really related to the OPs issue. DNS will not make the Pi available on a public IP address, which effectively is what is needed here. – stevieb Aug 25 '16 at 15:54

If your intent is to host a webserver then your best bet is using some sort of a reverse SSH tunnel to bypass the CGNAT, typical options to do that is using a service like Ngrok (and other paid alternatives), localtunnel (slightly buggy and reliability issues), or serveo.net (free to use with limitations).

Here's a handy guide, Access your Raspberry Pi from internet, that can walk you through the process of setting up a reverse SSH on a Raspberry Pi, but presumably it can be applied on any linux system with terminal.

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.