Installation guide

Chapter 12.
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol (DHCP) is network protocol for automatically assign-
ing TCP/IP information to client machines. Each DHCP client connects to the centrally-
located DHCP server which returns that client’s network configuration including IP address,
gateway, and DNS servers.
12.1. Why Use DHCP?
DHCP is useful for fast delivery of client network configuration. When configuring the client
system, the administrator can choose DHCP and not have to enter an IP address, netmask,
gateway, or DNS servers. The client retrieves this information from the DHCP server. DHCP
is also useful if an administrator wants to change the IP addresses of a large number of sys-
tems. Instead of reconfiguring all the systems, he can just edit one DHCP configuration file
on the server for the new set of IP address. If the DNS servers for an organization changes,
the changes are made on the DHCP server, not on the DHCP clients. Once the network is
restarted on the clients (or the clients are rebooted), the changes will take effect.
Furthermore, if a laptop or any type of mobile computer is configured for DHCP, it can be
moved from office to office without being reconfigured as long as each office has a DHCP
server that allows it to connect to the network.
12.2. Configuring a DHCP Server
You can configure a DHCP server using the configuration file /etc/dhcpd.conf.
DHCP also uses the file /var/lib/dhcp/dhcpd.leases to store the client lease database.
Refer to Section 12.2.2 for more information.
12.2.1. Configuration File
The first step in configuring a DHCP server is to create the configuration file that stores the
network information for the clients. Global options can be declared for all clients, or options
can be declared for each client system.
The configuration file can contain any extra tabs or blank lines for easier formatting. The
keywords are case-insensitive, and lines beginning with a hash mark (#) are considered com-
ments.
There are two types of statements in the configuration file:
Parameters state how to perform a task, whether to perform a task, or what network
configuration options to send to the client.
Declarations describe the topology of the network, describe the clients, provide ad-
dresses for the clients, or apply a group of parameters to a group of declarations.
Some parameters must start with the option keyword and are referred to as options. Op-
tions configure DHCP options; whereas, parameters configure values that are not optional
or control how the DHCP server behaves.
Parameters (including options) declared before a section enclosed in curly brackets ({ }) are
considered global parameters. Global parameters apply to all the sections below it.