Exposing local server to the public internet
February 28, 2019
Intro
In days when we have cloud operator, exposing local server to the public internet is not a common thing to do. On other hand with IOT beign a thing, sometimes we want to have some device sitting in our private home network behind router nat accessible from internet.
Router port forwarding
In general typical home network consist of router, which is our gate to internet. Everything behind router sits in private network, to expose a server in this private network, router has to be configured to forward all trafic comming to it.
Keep in mind that this approach requires public ip assigned to our router from ISP.
In tp-link routers it looks like this:
Forwarding
->Virtual Servers
->Add virtual server entry
service port
- port that will be called from outsideinternal port
- port of our local serverip address
- local ip address to the serverprotocol
- tcp, udp or both can be chosenstatus
- turn off forwarding without deleting entrycommon service port
- configuration templates
Now check your public ip here and use it to access the server.
Aternatives
Alternatively there are tools that do all this trickery and more.They can even help you if you don’t have public ip. If interested check ngrok here.