The DHCPCD package provides a DHCP Client for network configuration.
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
First install the service from the CLFS Bootscripts package:
tar -xvf bootscripts-cross-lfs-3.0-20140710.tar.xz cd bootscripts-cross-lfs-3.0-20140710 make install-service-dhcpcd
Finally, create the /etc/sysconfig/network-devices/ifconfig.eth0/dhcpcd
configuration file using the following commands. Adjust
appropriately for additional interfaces:
cd /etc/sysconfig/network-devices &&
mkdir -v ifconfig.eth0 &&
cat > ifconfig.eth0/dhcpcd << "EOF"
ONBOOT="yes"
SERVICE="dhcpcd"
# Start Command for DHCPCD
DHCP_START="-q"
# Stop Command for DHCPCD
DHCP_STOP="-k"
EOF
The values of these variables must be changed in every file to
match the proper setup. If the ONBOOT
variable is set to “yes” the
network script will bring up the Network Interface Card (NIC)
during booting of the system. If set to anything but
“yes” the NIC will be
ignored by the network script and not be brought up.
The SERVICE
variable defines the method
used for obtaining the IP address. The CLFS-Bootscripts package has
a modular IP assignment format, and creating additional files in
the /etc/sysconfig/network-devices/services
directory
allows other IP assignment methods.
The DHCP_START
and DHCP_STOP
variables arguments that are passed onto
dhcpcd
when starting and stoppping
the service. More information about what can be passed can be found
in the dhcpcd(8)
man page.
To configure another Static Interface, Follow Section 12.5, “Static Networking Configuration”.