1. Introduction

2. Useful resources

3. Getting the package

4. Configuration

5. Starting and stopping

1. Introduction

A DHCP-server, or Dynamic Host Configuration Protocol Server allows hosts on a TCP/IP network to request and be assigned IP addresses, and also to discover information about the network to which they are attached. This gives you the advantage that you don't have to run around every client to change a specific setting and that it's very easy to attach a new host to the network.

2. Useful resources

The main website for the DHCP-server is at

3. Getting the packages / Install

Before you can start installing the daemon, you should check the way your current kernel is compiled. At least CONFIG_PACKET and CONFIG_FILTER should be set to 'YES' before you can continue.

Allthough there are RPM-packages for every RedHat type, I prefer to install the DHCP-server from source. Installation is very clear and simple. Download the package, unzip it and compile it.
 tar zxvf dhcp-3.tar.gz
 cd dhcp-3

 make install

4. Configuration

Like every daemon, there's a configuration file that holds all the directives. This is how mine looks like
 deny client-updates;
 ddns-update-style interim;

 subnet netmask {
    range dynamic-bootp;

    option routers;
    option subnet-mask;

    option nis-domain "";
    option domain-name "";
    option domain-name-servers;
    option netbios-name-servers;
    option ntp-servers;
    option smtp-server;

    default-lease-time 360000;
    max-lease-time 259200;

 # Client-definitions

 host big-daddy {
    hardware ethernet 00:a0:d9:cb:94:8a;
The first two lines instruct the DHCP server NOT to accept dynamic DNS-updates. This will only work with BIND and I'm not using BIND as a name-server (note : when you install DHCP-server from RPM you'll probably don't have this option because the RPM's are build from the version 2 sourcetree).

Next, I define the subnet for which I want to handout DHCP-leases. You can have several ranges in your config-file. With subnet I indicate the net and with netmask the corresponding netmask.

For my subnet I set that the dhcp-server is allowed to hand-out ip-addresses in the range to This is done with range dynamic-bootp. Next I include some options.
  option routers specifies my internet-gateway.
  option subnet-mask is the default netmask for my clients.
  option nis-domain my NIS-domain
  option domain-name the default domain-name if I use FQDN
  option domain-name-servers the name-servers for my network
  option netbios-name-servers the default WINS-server
  option ntp-servers my local timeserver
  option smtp-server the smtp-server (only 1 server)
The last section in my config file is the client-definition for one host. Allthough all hosts are defined with dynamic addresses, I'd like to be sure that one host always receives the same ip. This can be done with the host-section. You only need to specify the network-interface MAC-address with hardware and the ip-address with fixed-address.

Now, before you can start the DHCP-server you need to make one last file : the leases file. Issue this :
touch /etc/dhcpd.leases

5. Starting and stopping

According to the default RedHat style, you should create a decent start / stop initscript. You can copy/paste the text below or download my dhcpd-initscript. This is how my init-script looks like :
 # dhcpd This shell script takes care of starting and stopping
 # dhcpd.
 # chkconfig: - 65 35
 # description: dhcpd provide access to Dynamic Host Control Protocol.

 # Source function library.
 . /etc/rc.d/init.d/functions

 # Source networking configuration.
 . /etc/sysconfig/network

 # Check that networking is up.
 [ ${NETWORKING} = "no" ] && exit 0

 [ -f /usr/sbin/dhcpd ] || exit 0
 [ -f /etc/dhcpd.conf ] || exit 0
 [ -f $LEASEFILE ] || exit 0


 start() {
    # Start daemons.
    echo -n $"Starting $prog: "
    daemon /usr/sbin/dhcpd -lf $LEASEFILE eth0
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
    return $RETVAL

 stop() {
    # Stop daemons.
    echo -n $"Shutting down $prog: "
    killproc dhcpd
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcpd
    return $RETVAL

 # See how we were called.
 case "$1" in
    if [ -f /var/lock/subsys/dhcpd ]; then
    status dhcpd
    echo $"Usage: $0 {start|stop|restart|condrestart|status}"
    exit 1

 exit $RETVAL

This is really about all there is with setting up a DHCP-server for your local-LAN.