Portforwarding Explained [GeekLK]
If you want to reach your friend through the phone call you’ll need his/her phone number. Likewise in IP Network environment to reach a host or a server you need an address called IP Address Eg- 192.168.1.10. And the network services requesting on that host or server is separated by protocols which also have numbers assigned known as ports, such as port 80 is used for (HTTP) web services, port 25 is used for SMTP (email) services and so on. You can check commonly used ports here. For an example if you are going to visit a website, the data packet will looks like 22.214.171.124:80 <target ip>:<protocol>.
To explain port forwarding we’ll take two scenarios which are the two typical ways connecting to the internet.
Scenario 1 – Using Dial-up modem
When u subscribe for an ADSL connection. You will need to buy an ADSL modem or a router. We assume that you have a usb modem. And you will have to create a dial-up connection on your PC to connect to the internet. When you enter “ifconfig” in the command prompt after connecting, you’ll see a public IP address assigned to the computer. Based on the diagram anyone on the internet will be able to establish a direct connection to your PC. For example if you run a web server on your PC anyone on the internet entering your IP address in their browser will get your web page.
Scenario 2 – Using ADSL router
This time let’s say you have an ADSL Router connecting to the internet while sharing the internet with other PCs. PCs behind the router needs to be assigned a private IP address such as 192.168.1.xx. ADSL router will get the public IP address based on the diagram. What ADSL routing function basically does is interconnecting public (WAN) and private (LAN) networks. Along with the NAT (Network Address Translation) function more than one PC in the local network can use the internet with one public IP address.
An outsider will only be able to connect to the public IP address, but the web server is in the private area with a different IP address range (check the IP address article here). So if someone wants to visit the website of your web server from outside, the requesting packet destined with port 80 (HTTP) must be forwarded to the web server. Here Port forwarding comes to play. Otherwise packet will be dropped as router doesn’t hold a web server on it’s own. So the Port Forwarding is used to forward the packets requesting for services in the local network from outside. To configure it on the router most routers have named it Port Forward, Games and Applications or Virtual Server.