Friday, July 11, 2008

Setting up your own server

Setting up your own server on a machine which has its static global ip is straight forward, just install the server application and done.

But on a machine that is hidden from outside network behind a NAT router requires a some tweaking.

Common Configuration for such a machine is

ISP----------NAT Router-------Host Machine(Your Machine)The configuration shown in picture. As the nearest public ip to your machine is the ip assigned by the ISP ( which is dynamic) beyond this (toward your machine these are two more ips( gateway and your machine ips that are private). NAT rounter ( ADSL, DSL router prevent access to you machine by any other machine from outside. The broken line shows the separation between inside and outside world. The NAT router is responsible for this separation. Key to the solution is to create a hole in this separation boundary. And this is done through the technique of port forwarding. Port forwarding is done for a given port.

If you have to install a webserver then port number 80 and 443 should be forwarded. If you have to set up a mail server the port number 25 should be forwarded.

There are three pieces of information given to router

1. Outside port (port on which request will arrive from outside at the out side of NAT router.

2. Inside port (port on which your machine will receive the request)

3. Machine IP for which this port should be forward( this is the ip of your machine).

To implement the last step , the automatic assigning of IP on your machine by DHCP should be turned off. You must assign IP to your machine manually.

To assign IP manually and turn of DHCP follow these steps.

1. Go to properties of My Network places

2. Go to the properties of your network connection

3. Select Internet TCP/IP from list, and click properties button.

4. Select the option "Use following ip addresses" and then enter the information asked.

To verify above setting check that your internet connect, try openning website.

Now the final step. to Forward port.

Router provide functionality through virual server concept. Actual method to do this depends on router you are using(www.portforward.com). For router given by MTNL (UT-300R2U) Startcom Router steps are:

Assume Gateway ip is 192.168.1.1

Manually assigned IP of your machine is 192.168.1.2

1. open cmd

2. Type telnet 192.168.1.1

3. enter login, password default is (admin, admin) respectively

4. choose NAT from options

5. choose Virtual Server from options

6. choose Add

7. enter service name : anyname

enter start outside port: 80

enter end outside port: 80

enter start inside port :80

enter end inside port:80

enter local machine address: 192.168.1.2

8 go back to main menu and save and exit. do not forget the save before u exit.

Port can be forwarde for all other ports also depeding on the server you are going to install.

Now all the requests arriving for the global ip at port 80 will be sent to your machine at port 80.

To provide a domain name to you dynamic public ip visit dyndns, or no-ip websites.Setting up your own Server

No comments: