DHCP Client Deamon
Preparation
- Perform this stage using your functioning PC.
- Download the dhcpcd (DHCP client daemon) source code from http://www.phystech.com/download/.
- Visit http://www.phystech.com/download/ and click on the link for the source code of the latest version of dhcpcd. You will need the source code in
.tar.gzformat.- At the time of writing the latest version of dhcpcd was version 1.3.22-p14, so the file downloaded was
dhcpcd-1.3.22-p14.tar.gz.
- At the time of writing the latest version of dhcpcd was version 1.3.22-p14, so the file downloaded was
- You will be asked to where you wish to save the file. Chose a safe place and make a note of it.
- The download is about 144kb and will only take a few seconds over a modem, and a lot less over a broadband connection.
- If you are using a download accelerator program, it will save the file to your default download directory.
- Visit http://www.phystech.com/download/ and click on the link for the source code of the latest version of dhcpcd. You will need the source code in
- Burn the
.tar.gzfile to a CD. This page assumes that the subdirectory/appsis used for the.tar.gzfile. The CD-ROM can be a multi-session disk.- Use your CD burning software to create an ISO9660 disc image with the file
dhcpcd-1.3.22-p14.tar.gzin the/appsdirectory. - Burn the CD and verify the data stored on it.
- Use your CD burning software to create an ISO9660 disc image with the file
Booting
- Perform this stage and subsequent stages, unless otherwise stated, using your Core Linux PC.
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.- Wait for the following text to appear:
localhost login: - Type
rootand press Enter. - The screen will display this message:
Password: - Enter the password for
rootthat you set earlier. - You will be shown a prompt that looks like this:
[~]#
- Wait for the following text to appear:
Extract the source
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom.- At the prompt enter:
mount /dev/hdb /mnt/cdrom - You will see the following line appear:
mount: block device /dev/hdb is write-protected, mounting read-only
- At the prompt enter:
- Change to the
/appsdirectory on the CD-R.- At the prompt enter:
cd /mnt/cdrom/apps - The prompt will change to:
[/mnt/cdrom/apps]#
- At the prompt enter:
- Copy the
dhcpcd-1.3.22-p14.tar.gzfile to the directory/usr/src.- At the prompt enter:
cp dhcpcd-1.3.22-p14.tar.gz /usr/src - The system will not display a message if everything is OK.
- At the prompt enter:
- Change to the
/usr/srcdirectory and extract the source from the.tar.gzfile.- At the prompt enter:
cd /usr/src - The prompt will change to:
[/usr/src]# - At the prompt enter:
tar -zxvf dhcpcd-1.3.22-p14.tar.gz - A long stream of unzipping files and directories should scroll up the screen for a second or two.
- At the prompt enter:
Configure and compile
- Change to the
/usr/src/dhcpcd-1.3.22-p14directory.- At the prompt enter:
cd dhcpcd-1.3.22-p14 - The prompt will change to:
[/usr/src/dhcpcd-1.3.22-p14]#
- At the prompt enter:
- Run the
./configurescript. You will need to add an argument specifying the architecture of the system, for example:./configure --build=i686-pc-linux-gnu- At the prompt enter:
./configure --build=i686-pc-linux-gnu - A long stream of processes should scroll up the screen for about twenty seconds.
- The script finishes with the line:
config.status: executing depfiles commands
- At the prompt enter:
- Run the
makeprogram.- At the prompt enter:
make - A long stream of processes should scroll up the screen for about ten seconds.
- The program finishes with the line:
gcc -O2 -fomit-frame-pointer -Wall -march=i686 -s -O2 -o dhcpcd peekfd.o udpipgen.o buildmsg.o signals.o arp.o dhcpconfig.o client.o cache.o dhcpcd.o
- At the prompt enter:
- Run the
makeprogram with the argumentinstall.- At the prompt enter:
make install - A few processes should scroll up the screen for a second or two
- The program finishes with the line:
make[1]: Leaving directory 'usr/src/dhcpcd-1.3.22-p14'
- At the prompt enter:
Initial Testing
- If your ethernet interface is already up, take it down.
- At the system prompt enter:
ifconfig eth0 down - The system will not display a message if everything is OK.
- At the system prompt enter:
- Start the dhcpcd client using
/usr/local/sbin/dhcpcd eth0.- At the prompt enter:
/usr/local/sbin/dhcpcd eth0 - The screen will not display a message if everything is OK.
- At the prompt enter:
- Use
ifconfigto check the IP address assigned to the interface.- At the system prompt enter:
ifconfig - The screen will show information relating to the
eth0andlointerfaces. Check the details for theeth0interface, and look for a line similar to:inet addr:192.168.0.15 Bcast:192.168.0.255 Mask:255.255.255.0 - The IP address, broadcast address and netmask assigned to the interface will vary with your network topology.
- At the system prompt enter:
Stopping dhcpcd
- Stop the dhcpcd client using
kill.- At the prompt enter:
kill `cat /etc/dhcpc/dhcpcd-eth0.pid` - The system will not display a message if everything is OK.
- At the prompt enter:
Automating dhcpcd
- This section details how to have dhcpcd start automatically when the computer boots and configure the ethernet interface. The advantage of this method is that you do not have to log in to assign your computer an IP address. If you wish to start dhcpcd manually after each reboot then skip this section.
- Append the following line to the
/etc/rc.d/rc.muscript:If you have previously configured the interface to be assigned a static IP address on boot, you will need to remove the/usr/local/sbin/dhcpcd eth0ifconfigline from the script and replace it with the above line. You will also need to remove any lines containingroutecommands, as this information is set dynamically by the dhcp client. You can also add comments and echoes for your own information.- At the prompt enter:
nano /etc/rc.d/rc.mu - The screen will show the contents of
/etc/rc.d/rc.muwith information about the file at the top and bottom of the screen. - Locate the line that sets the IP address of the interface using the
ifconfigcommand. - Replace the line containing
ifconfigwith the following line:/usr/local/sbin/dhcpcd eth0 - Save the file and exit the text editor.
- Press Ctrl+x on the keyboard.
- The contents of the white line at the bottom of the screen will change to read:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? - Type
y. - The contents of the white line at the bottom of the screen will change to read:
File Name to write: /etc/rc.d/rc.mu - Press Enter.
- You will be returned to the system prompt.
- Reboot the system and check that the interface has been assigned an IP address.
- At the system prompt enter:
shutdown -r now - Wait for the system to reboot.
- As the system reboots, watch for any error messages.
- Once the system has rebooted, enter
ifconfigat the system prompt and check for a valid IP address on interface eth0.
- At the system prompt enter:
- At the prompt enter:

The text of this page is licensed under a Creative Commons License.
