Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [175]

By Root 2711 0
the DHCP server by using the generic all-1s broadcast address because they don’t yet know their subnet masks and therefore cannot use the subnet broadcast address. Unfortunately, some kernels (HP-UX and Linux) use only the subnet broadcast address. This problem can prevent the client and server from ever connecting and exchanging information. ISC’s documentation includes workarounds that address this situation. Mixed environments are still a bit iffy for DHCP services, though; test carefully after you install a new server or a new type of client.

ISC’s DHCP server speaks the DNS dynamic update protocol. Not only does the server give your host its IP address and other networking parameters, but it also updates the DNS database with the correct hostname-to-IP-address mapping. See page 459 for more information about dynamic DNS updates.

We briefly discuss the DHCP protocol, then explain how to set up the ISC server that implements it. We defer a discussion of DHCP client configuration issues until the vendor-specific sections later in this chapter.

How DHCP works


DHCP is a backward-compatible extension of BOOTP, a protocol that was originally devised to enable diskless UNIX workstations to boot. BOOTP supplies clients with their IP address, netmask, default gateway, and TFTP booting information. DHCP generalizes the parameters that can be supplied and adds the “lease” concept.

A DHCP client begins its interaction with a DHCP server by sending a “Help! Who am I?” DHCPDISCOVER15

message. Since it knows neither its own nor the server’s IP address, it sends the message to the broadcast address 255.255.255.255, with a source address of 0.0.0.0. The DISCOVER message can contain hints from the client, such as information about the client’s hardware architecture or a specific address the client wants to request.

The DISCOVER message is usually received by a DHCP server attached to the same subnet. However, DHCP servers on different subnets can also receive the message via a proxy called a “relay agent.”

Servers respond with an OFFER message containing a suggested address and other basic parameters. The client receives the OFFER message(s)—possibly from multiple servers—and accepts one of the offers by sending a REQUEST message back to the offering server. Normally, the server responds with an ACK acknowledgment and allocates the address.

The ACK message can include any number of configurable parameters; it also specifies the duration of the address lease. The server can respond to a faulty REQUEST with a NAK (negative acknowledgment), indicating that the client should restart its discovery process.

Before using an address, the client checks it out with ARP. If the address appears to already be in use, the client complains to the server with a DECLINE message and restarts negotiations.

When the client’s lease nears expiration, it should renew the lease by sending another REQUEST message if it intends to continue using the allocated address. Should a client decide to terminate its lease, it does so with a RELEASE message.

The server is obliged to keep track of the addresses it has handed out, and this information must persist across reboots. Clients are supposed to keep their lease state across reboots too, although many do not. The goal is to maximize stability in network configuration.

Incidentally, DHCP is normally not used to configure dial-up PPP interfaces. PPP’s own PPPCP (PPP Control Protocol) typically fills that role.

ISC’s DHCP server


ISC’s DHCP server is available from ftp.isc.org or www.isc.org. The details that follow are for version 2 of the package. The 3.0 release is imminent, so be sure to check the version you actually download against these instructions.

Unpack the tar.gz file and cd to the distribution directory. You should see subdirectories for the server, the client, and the relay agent, along with a directory of shared code. Run ./configure followed by make and make install to build and install each of the pieces.

To configure the DHCP server, dhcpd, you need to edit the sample

Return Main Page Previous Page Next Page

®Online Book Reader