Port Forwarding On a DSL Home Router

Sometimes there will be a need to access your system from outside your home network (LAN). Typical uses are, running a webserver, ftp server at home.
In order to make your computer visible outside your home network your computer should have a WAN ip address. On a typical broadband DSL setup, WAN ip address is actually assigned to the router. So what we do is, we forward the port used by the application to the LAN ip address. That means, any call to the particaular port from internet to our WAN ip is forwarded to the LAN ip address of your machine. In this tutorial I will demonstrate how to forward port 80 (which is used by webserver).

Note: Typically WAN ip address would be dynamic. What this means is, everytime you reboot the server your WAN ip gets changed. A work around is explained here.
Go to (the default address of your router)

Login with your user name and password. By default username and password is 'admin'

On the left pane click on securty and then click on Port Forwarding. (this varies from router to router. Please refer your router's user manual) Click on Add button, click on user defined, give a name for the rule. Type in your computers LAN ip address (the machine where you want requests to be hit). Choose the protocol as TCP. Type in Start and End port as 80 (for both internal and external). Click on Add and your new rule is ready.

Few Of the common Applications and its Port numbers are given below,

Web Server - 80
SSH (Secure Shell) - 22
VNC (Virtual Network Connection)- 5901
RDP (Remote Desktop in Windows) - 3389