The DHCP package comes with both a client (dhclient) and a server program for using DHCP. If you want to install this package, the instructions can be found at DHCP-3.0.6. Note that if you only want to use the client, you do not need to run the server and so do not need the startup script and links provided for the server daemon. You only need to run the DHCP server if you're providing this service to a network, and it's likely that you'll know if that's the case; if it isn't, don't run the server! Once you have installed the package, return here for information on how to configure the client (dhclient).
To configure
dhclient, you need to
first install the network service script, /etc/sysconfig/network-devices/services/dhclient
included in the blfs-bootscripts-20080816 package (as
root
):
make install-service-dhclient
Next, create
the /etc/sysconfig/network-devices/ifconfig.eth0/dhclient
configuration file with the following commands as the root
user. Adjust as necessary for additional
interfaces:
install -v -d /etc/sysconfig/network-devices/ifconfig.eth0 &&
cat > /etc/sysconfig/network-devices/ifconfig.eth0/dhclient << "EOF"
ONBOOT="yes"
SERVICE="dhclient"
DHCP_START="-q <add additional start parameters here>
"
DHCP_STOP="-q -r <add additional stop parameters here>
"
# Set PRINTIP="yes" to have the script print
# the DHCP assigned IP address
PRINTIP="no"
# Set PRINTALL="yes" to print the DHCP assigned values for
# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
PRINTALL="no"
EOF
For more information on the appropriate DHCP_START
and DHCP_STOP
values, examine the man page for dhclient.
Finally, you
should create the /etc/dhclient.conf
file using the following commands as the root
user:
You'll need to add a second interface definition to the file if you have more than one interface.
cat > /etc/dhclient.conf << "EOF"
# dhclient.conf
interface "eth0"{
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
}
# end dhclient.conf
EOF
Last updated on 2008-04-11 13:53:54 -0500