Search code examples
network-programmingipportportforwarding

Understanding port forwading


I am looking to understand port forwarding, using the following example of a setup in my home.

Say I have a Smart TV with an ip address of 123.45.6.7 for example and a router with a static ip of 199.9.9.9.

To access the TV outside the network I need to set up port forwarding on my router, so let's say I set 123.45.6.7 to port 80 does this mean to access the tv via a http request I would do http://199.9.9.9:80/sony/IRCC and the request would be forwarded to the TV's IP address ? and what about authentication here?

Also what can I do if my ISP won't give me a static IP ?

Have I understood this correctly or am I way off ?


Solution

  • Yes this is correct.

    Port Forwarding would just result in the router forwarding requests to the tv set. Most routers don't offer the authentication capability with port forwarding, hence whichever authentication the tv uses would be used. You could however add a authenticating reverse proxy -

    https://en.wikipedia.org/wiki/Reverse_proxy https://thelowedown.wordpress.com/2008/10/12/reverse-proxy-with-apache/

    For more information on port forwarding : https://portforward.com/help/portforwarding.htm

    As for the ISP not providing static ip, you could use Dynamic DNS - https://en.wikipedia.org/wiki/Dynamic_DNS