12.8. DHCPCD-6.11.5

The DHCPCD package provides a DHCP Client for network configuration.

12.8.1. Installation of DHCPCD

If you wish to configure your network to connect to a DHCP server, you will first need to install a DHCP client. CLFS uses the DHCPCD package for this.

Prepare DHCPCD for compilation:

CC="gcc ${BUILD64}" ./configure \
    --prefix=/usr \
    --sbindir=/sbin \
    --sysconfdir=/etc \
    --dbdir=/var/lib/dhcpcd \
    --libexecdir=/usr/lib64/dhcpcd \
    --libdir=/usr/lib64

Compile the package:

make

This package does not come with a test suite.

Install the package:

make install

12.8.2. Creating the DHCP Network Interface Configuration File

The following is an example for the eth0 interface. Refer to the dhcpcd.conf man page for more information. This step may be skipped if default behavior of dhcpcd is required.

Create the /etc/dhcpcd.conf configuration file using the following commands. Adjust appropriately for additional options:

cd /etc &&
cat > dhcpcd.conf << "EOF"
# dhcpcd configuration eth0 interface
# See dhcpcd.conf(5) for details.

interface eth0
# dhcpcd-run-hooks uses these options.
option subnet_mask, routers, domain_name_servers

# The default timeout for waiting for a DHCP response is 30 seconds
# which may be too long or too short and can be changed here.
timeout 16
EOF

To configure another Static Interface, Follow Section 12.7, “Static Networking Configuration”.

12.8.3. Contents of dhcpcd

Installed files: dhcpcd

Short Descriptions

dhcpcd

dhcpcd is an implementation of the DHCP client specified in RFC 2131. It gets the host information from a DHCP server and configures the network interface automatically.