Introduction to dhcpcd

The dhcpcd package contains the dhcpcd client. This is useful for connecting your computer to a network which uses DHCP to assign network addresses.

Package information

Installation of dhcpcd

Install dhcpcd by running the following commands:

patch -Np1 -i ../dhcpcd-1.3.22-pl4-fhs-1.patch &&
./configure --prefix="" --sysconfdir=/var/lib \
--mandir=/usr/share/man &&
make &&
make install

Command explanations

patch -Np1 -i ../dhcpcd-1.3.22-pl4-fhs-1.patch : Dhcpcd unpatched puts all configuration and temporary files in /etc/dhcpc. This becomes very annoying when dhcpcd tells you it's running and it's not. You look in /var/run for the PID file, but it's not there, the PID file that needs deleting is in /etc/dhcpc. This patch brings this program into FHS compliance, but more importantly, puts files where you expect them to be.

--prefix="": There may be a good reason for abandoning the normal BLFS convention of using --prefix=/usr here. If you are installing DHCP, it is likely that it is required during the boot process and /usr may be network mounted, in which case dhcpcd wouldn't be available due to being on the network! Therefore, depending on your situation, you may want it to be installed in /sbin or /usr/sbin. This command installs to /sbin.

--sysconfdir=/var/lib: This command installs configuration files in the /var/lib directory.

--mandir=/usr/share/man: This command installs the man pages to the /usr/share/man directory.

Configuring dhcpcd

Config files


Configuration Information

To configure dhcpcd, you need to first install the network service script, /etc/sysconfig/network-devices/services/dhcpcd included in the blfs-bootscripts-5.1 package.

make install-service-dhcpcd

Now create the ifconfig.eth0 configuration file using the following commands. Adjust appropriately for additional interfaces.

Note: This will overwrite any existing file.

cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"
DHCP_START="[insert appropriate start options here]"
DHCP_STOP="-k [insert other stop options here]"

For more information on the appropriate DHCP_START and DHCP_STOP values, examine the man page for dhcpcd.

Finally, if the DHCP configured interface is used as your default gateway, you should remove the GATEWAY and GATEWAY_IF variables from /etc/sysconfig/network:

sed -i "s/GATEWAY/#&/" /etc/sysconfig/network


The dhcpcd package contains dhcpcd.



dhcpcd is an implementation of the DHCP client specified in RFC2131 and RFC1541 (depending on which options are specified).