Access Local device without Port Forwarding

ngrok is an service that enables us to connect to any device (inside LAN or internet facing) through any network with out port forwarding. One key advantage of using ngrok is that, you dont have to be local network as your device to access them. You can SSH, use FTP or Local device without Port Forwarding on your local network using ngrok.

How Ngrok work?

While starting the service on your device, Ngrok will give you a link that you can use to connect to the device from anywhere around the world. When we use that link to connect to the device, we are actually connecting to Ngroke and this connection between that device (device from which we are trying to access) and Ngrok is known as as Public Connection.

When a Public Connection is established, a proxy connection is started and this proxy connection is tied to the connection between ngrok and the Device which you are trying to access (Device in which ngrok service is running). Ngrok will then exchange information between the the public connection and the control connection.

Set Up Ngrok

In this session, I will show you a simple example using ngrok. I will start a simple python server (port 80) on my Raspberry Pi on my local network, set up ngrok on my Raspberry Pi and access the webpage from outside the LAN using the Ngrok link.

Step 1 – Set up an Account

Follow this link and create an Account in Ngrok.

Once you complete Sign up Process, you will be provided with an ‘authtoken’ which can be used to connect your Raspberry Pi to your Ngrok account. Take a note of it.

Step 2 – Download Ngrok

Download Ngrok on your pi.

Now extract the file using

unzip ngrok-stable-linux-amd64.zip

If everything goes well, you will see a file named “ngrok”

Step 3 – Connect your Account

Run the below command to set your ‘authtoken’

./ngrok authtoken 4BSL861jeVz9wt7AM91QM_aksO43YvcKgmtC4pxv

Step 4 – Start ngrok

Now you can run ngrok

./ngrok http 80

Step 5 – Start your server

Use python to start a simple HTTP server using the command

sudo python -m SimpleHTTPServer 80

Now enter the Ngrok URL on any web browser and you will see your page hosted on your local network.

Best WiFi Routers of 2018

Here is a list of World’s Best WiFi Routers of the year 2018. Make sure you grab one of them for High speed, Long Range, and Stable Internet connection.

http://www.cuteoffers.com/technology/best-wifi-routers-2018/

This way, you will be able to access any Local device without Port Forwarding

Rate the Project

Did you find this page useful? Help us to improve by rating this page.

Name Email Review Title Rating Review Content