Setting Up a DHCP Server

Install and configure dhcp. You can get the source tarball from RPMs and Debian packages are also available; just look for packages named "dhcp." Configure client PCs to point to your dhcp server, and you’re done.

A dhcp server can feed all network configuration data to the clients. The configuration file is /etc/dhcpd.conf. Here is a sample configuration:

# /etc/dhcpd.conf

default-lease-time 259200;

max-lease-time 518400;

subnet netmask {

option subnet-mask;

option broadcast-address;

option routers;

option domain-name "";


option domain-name-servers,;


This is pretty straightforward. The lease times are in seconds, so the minimum and maximum in this example are three days and six days. "Option routers" points to your Internet gateway, or the gateway to the subnet. A pool of 50 addresses is made available in the "range." The name servers are either your own private caching server or servers, or the name servers at your ISP.

This example uses private, nonroutable IPv4 (Internet Protocol Version 4) addresses. Here are the private IPv4 address classes, in both dotted-quad and Classless Inter-Domain Routing (CIDR) notation:     -  (10/8) - (172.16/12) - (192.168/16)

These are for use on private networks, so you’ll select your subnet ranges from these.