Port forwarding without router access how does it work

nat;port-forwarding

When I want to access a device that is behind a NAT from the outside world I would go to the router and set up port forwarding.

Now my question why does it work without configuring the router? For example it is possible to do port forwarding without configuring/accessing the router by going to Control Panel -> View Network Connections

Once In there I can see my router:

enter image description here

If I right click -> properties -> settings -> select services tab -> Add then I am able to configure port forwarding as:

enter image description here

(My computer that is hosting a website inside my network has IP 192.168.0.5)

I know the basics of how a router works but I do not understand how this can be done without a helper server (tcp/udp punch holing) or vpn. What is my computer doing when I set up this option in order to enable port forwarding?

This can also be done on Linux this video (https://youtu.be/bjsu5sFbMos) shows how.

Best Answer

The key is the UPNP https://en.wikipedia.org/wiki/Universal_Plug_and_Play

  • The router must be UPNP capable, and UPNP service must enabled. If disabled, process in the question won't work.

  • The configuration done via UPNP commands instead router's web interface. But in both case, router gets configured, just the method different.

Now my question why does it work without configuring the router?

In this case the OS configure your router.

What is my computer doing when I set up this option in order to enable port forwarding?

OS sends UPNP messages to the router. These are network packets, if you interested in deeply, you can find official UPNP protocol descriptions.

You can imagine it as there's 2 port-forward database. One managed by router web interface (portforward, virtual servers, naming different), another managed by clients of the routers. But both stored on the router, and apply to the router rules.

Related Question