Access your LAN behind a 4G router, from the outside, with ngrok


Because of the finite IPv4 address, the ISPs in some countries/regions provide private IP addresses as WAN IP for 3G/4G network. For this reason, it is not possible to open ports and access devices in LAN like NAS,IP camera or Web server ... 



If you want to access certain equipment on your LAN, several techniques can be used and ngrok is one of them. 


Here I'll share how I've managed to access my web server behind Archer MR600 using ngrok :


To implement this solution, you must:

1- Create an account on (optional)

2- Install the ngrok client on the machine, in my case it was a linux machine, but the instructions are easily transposed to another PC / OS.




1- Install ngrok :


wget      #download

unzip     #unzip 

rm       #delete the zip file 


2- Configure the authtoken : (optional) the authtoken can be found in your dashboard after creating the account

./ngrok authtoken xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


3- run 

./ngrok http 80


** my server was running on port 80 , you must change the port number if you server is running on another port 


ngrok will display a UI in the terminal with the public URL of the tunnel and other status and metrics information about connections made over the tunnel.



4- access the server with the forwarding URL


That’s it – quick and easy




What if you want to access other devices like a NAS ?


In this case you must run ngrok on a machine that will route the traffic to other device in LAN ,

for example if you want to access the Web GUI of your NAS ,you can setup ngrok on a Raspberry Pi or a PC , then execute the following command:


ngrok http

where is the IP of your NAS , and 80 is the port number.







Thank you

Hello, World ! Wi-Fi


Witam, mam taki problem z sms-em nie wyswietla do routera sms Archer MR600, znowu musze zrestartowac router do stanu fabrycznego i wtedy wraca do normy. 




Great solution ! I was looking for a way to access to my Raspberry's server, behing a 4G router... that's the first time something works (with my level of network knowledge...)  ! Thank you very much.


Tip : a very simple way to automatically launch the function, at Raspberry start : search on for /vincenthsu/systemd-ngrok


Limitation : "Forwarding" adress changes at every restart :-( Except if you pay for an upgrade... Intermediate solution is to log on the Ngrok account, and get the updated public adress in "Endpoint" area.


Big thanks for this solution, and big thanks to TP link support team, that shared it to me.