Sunday, August 24, 2008

Forming a small network at home (PART IV)

This is the last in series of this article. Up till now we have relied on either manual settings or the DSL modem's ability to act as a DHCP server. If you do not have a DSL, or for that matter if your DSL modem does not have the capability to become a DHCP, then you are stuck with assigning the configuration manually. And like me if you plug-in your laptop at work and at your home, you will be changing your network parameters back and forth, which can be a pain sometimes. DHCP significantly reduces the system administration load.

Thankfully enough, Microsoft has provided a small DHCP service in Microsoft Windows XP Professional/Home Editions, that lets you set up a very simple DHCP server. Now this DHCP service may not be very configurable, but it caters to the basic necessity, and that is all we want at this point in time.

Revising DHCP basics
At this point we need to revise what we talked about DHCP. DHCP is simply a protocol through which IPs on a network are managed. A DHCP server is a computer that manages the assignment of IPs over a particular network. Say, if a new computer joins a network which has a designated DHCP server, then it is the DHCP server's responsibility to assign the new computer with IP configuration. The computer being assigned the IP will become a DHCP client. There should be only one DHCP server over a network but there can be multiple DHCP clients. Furthermore, a DHCP server and a DHCP client cannot be the same machine.

How does it work? When a DHCP client joins a network, it broadcasts a request to all machines on that network for IP configurations. Only the DHCP server responds to that request and it leases an IP address to the new computer along with assigning other network configurations. The validity period for this lease depends on the DHCP server being used. Some DHCP servers also give an option to reserve IP addresses against MAC (Media Access Control) addresses.

But as discussed before, the DHCP service provided with Microsoft Windows XP is a very basic one and it does not provide us features such as customizing the lease validity period and reservation of IPs.

Setup a DHCP server
To setup a DHCP server on Microsoft Windows XP, you need to allow Internet Connection Sharing on a connection other than your Local Area Connection (through which you access your home network). If you have a modem installed, then your task will become much simpler. If not, then you will have to setup a Loopback network adapter, which is a discussion for another article. The procedure for allowing Internet Connection Sharing on either the Loopback network adapter or the Dialup connection is the same.

To setup a DHCP server, do the following:


  1. Go to Start > Settings > Network Connections,


  2. Right-click on your Dial-up connection or your Loopback connection and click on 'Properties',


  3. In the 'Advanced' tab, check the box labelled 'Allow other network users to connect through this computer's Internet Connection'. Keep other boxes unchecked,


  4. In the combo-box labelled 'Home networking connection:', select 'Local Area Connection',


  5. Click OK,
  6. Windows will pop-up a dialog box to inform you that it is assigning a manual IP to the computer and so on. Click OK on that as well.
NOTE: I feel obligated to highlight one very obvious yet important fact here. The Operating System on the DHCP server must be running before you connect or start other computers. This must always be the case. This is because the DHCP clients will only try to automatically attain an IP either when the Operating System starts or when the network cable is plugged in. There are other conditions and remedies to this, but for the sake of keeping this article clutter free, we will discuss that in a future article.

Setup a DHCP client
Now that a computer on your network has a designated DHCP server, you need to configure all other machines on the network as DHCP clients. We've already discussed how to do this in the previous part of this article. You can go to the article Forming a small network at home (PART III) and move to the heading "Setup your computer as a DHCP client".

No comments: