DHCP-3.0.6

Introduction to DHCP

The DHCP package contains both the client and server programs for DHCP. dhclient (the client) is useful for connecting your computer to a network which uses DHCP to assign network addresses. dhcpd (the server) is useful for assigning network addresses on your private network.

Package Information

Additional Downloads

DHCP Dependencies

Required

Net-tools-1.60 (you may omit net-tools by using the optional patch to utilize iproute2.

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/dhcp

Kernel Configuration

You must have Packet Socket support (Device Drivers ⇒ Networking Support ⇒ Networking Options ⇒ Packet Socket) compiled into the kernel.

Installation of DHCP

First fix a problem with always regenerating /etc/resolv.conf whether the DNS server has changed or not.

patch -Np1 -i ../dhcp-3.0.6-client_dns-1.patch

If you chose not to install net-tools, apply the iproute2 patch:

patch -Np1 -i ../dhcp-3.0.6-iproute2-1.patch

Install DHCP by running the following commands:

./configure &&
make

This package does not come with a test suite.

Now, as the root user:

make LIBDIR=/usr/lib INCDIR=/usr/include install

Command Explanations

LIBDIR=/usr/lib INCDIR=/usr/include: This command installs the library and include files in /usr instead of /usr/local.

Configuring DHCP

Config Files

/etc/dhclient.conf and /etc/dhcpd.conf

Configuration Information

Information on configuring the DHCP client can be found in Chapter 13, Connecting to a Network.

Note that you only need the DHCP server if you want to issue LAN addresses over your network. The DHCP client doesn't need this script to be used. Also note that this script is coded for the eth1 interface, which may need to be modified for your hardware configuration.

Install the /etc/rc.d/init.d/dhcp init script included in the blfs-bootscripts-20080816 package.

make install-dhcp

The lease file must exist on startup. The following command will satisfy that requirement:

touch /var/state/dhcp/dhcpd.leases

The following commands will create a base configuration file for a DHCP server. There are several options that you may want to add (information that is passed back to the DHCP client) and those are covered in the man pages for dhcp.conf.

cat > /etc/dhcpd.conf << "EOF"
default-lease-time 72000;
max-lease-time 144000;
ddns-update-style ad-hoc;

subnet <192.168.5.0> netmask <255.255.255.0> {
  range <192.168.5.10> <192.168.5.240>;
  option broadcast-address <192.168.5.255>;
  option routers <192.168.5.1>;
}
EOF

All addresses should be changed to meet your circumstance.

Contents

Installed Programs: dhcpd, dhcrelay, dhclient, dhclient-script, and omshell
Installed Libraries: bdhcpctl.a, libomapi.a
Installed Directories: /var/state/dhcp, /usr/include/omapip, and /usr/include/isi-dhcp

Short Descriptions

dhclient

is the implementation of the DHCP client.

dhcpd

implements Dynamic Host Configuration Protocol (DHCP) and Internet Bootstrap Protocol (BOOTP) requests for network addresses.

dhcrelay

provides a means to accept DHCP and BOOTP requests on a subnet without a DHCP server and relay them to a DHCP server on another subnet.

omshell

provides an interactive way to connect to, query, and possibly change, the ISC DHCP Server's state via OMAPI, the Object Management API.

Last updated on 2008-05-09 08:00:42 -0500