DHCP Software Installation and Configuration

Installation of the DHCP client and server is fairly straightforward, mainly because Ubuntu already includes dhciient in a default installation, but also because installing software is easy using synaptic or apt-get.

DHCP dhclient

As previously mentioned, DHCP use for an installed NIC is easily accomplished when installing Ubuntu on your host (read more about installation in Chapter 3, "Installing Ubuntu"), and during the network step of installation, you can choose to have DHCP initiated at boot time. If you choose to do this (and choose to install the DHCP client package), the DHCP client, dhciient, sends a broadcast message that the DHCP server replies to with networking information for your host. That is it; you're done.

If you choose to install from source, you will have to (as root) download and install the server packages that include dhciient. Unpack the source file, run ./configure from the root of the source directory, run make, and then run make instaii. This should put the DHCP client binaries where they will start at the correct time in the boot process.

You can however, fine-tune how dhciient works, and where and how it obtains or looks for DHCP information. You probably will not need to take this additional effort; but if you do, you can create and edit a file named dhciient.conf, and save it in the /etc directory with your settings. A few of the dhciient.conf options include

• timeout time ; How long to wait before giving up trying (60 seconds is the default)

• retry time ; How long to wait before retrying (five minutes is the default)

• seiect-timeout time ; How long to wait before selecting a DHCP offer (zero seconds is the default)

• reboot time ; How long to wait before trying to get a previously set IP (10 seconds is the default)

• renew date ; When to renew an IP lease, where date is in the form of <weekday> <year>/<month>/<day> <hour>:<minute>:<second>, such as 4 2004/1/1 22:01:01 for Thursday, January 4, 2004 at 10:01 p.m.

See the dhciient.conf man page for more information on additional settings.

DHCP Server

Again, the easiest way to install the DHCP server on your computer is to use either synaptic or apt-get to retrieve the dchp3-server package. If you are so inclined, you can go to the Internet Software Consortium (ISC) website and download and build the source code yourself (http://www.isc.org/).

If you decide to install from a source downloaded from the ISC website, the installation is very straightforward. Just unpack your tar file, run ./configure from the root of the source directory, run make, and finally, if there are no errors, run make install. This puts all the files used by the DHCP daemon in the correct places. If you have the disk space, it is best to leave the source files in place until you are sure that DHCP is running correctly; otherwise, you can delete the source tree.

Note

For whichever installation method you choose, be sure that a file called /etc/dhcp3/dhcpd.leases is created. The file can be empty, but it does need to exist in order for dhcpd to start properly.

Was this article helpful?

0 0

Post a comment