1 TITLE: DHCP client daemon
3 AUTHOR: Thinus Pollard <thinusp@olienhout.org.za>
6 How to setup a DHCP client daemon. This is used with cable modems and some (most?) networks.
9 I've got a DHCP based network, and after installing the
10 DHCP client deamon according to Simon Perreault's <nomis80@videotron.ca> hint,
11 I discovered a few things that makes it much better.
13 How to install and configure the DHCP client daemon according to the LFS
14 standards. This works for a network card, I'm not sure about the cable
15 modems. Gimme a shout if it doesn't work for you. I think the deamon goes
16 and look for your network interface (compiled into the kernel) and sets it
17 up accordingly. I don't know, i've only got one network card and no modems ;)
19 1. Get dhcpcd-1.3.19-pl2.tar.gz at ftp://ftp.phystech.com/pub/ . Unpack.
21 2. Execute the following in the source directory:
23 The archive contains some cache file that plays havoc with an LFS install ;)
24 (or at least it did on mine)
30 ./configure --prefix=/usr
32 There is now a bug in the Makefile that installs the config file directory
33 to /usr/etc and the deamon wants it in /etc, so.......
35 sed "s/\${prefix}\/etc/\/etc/" Makefile > Makefile2
43 As Simon said before, the deamon wants the /etc/dhcpc directory, not the
44 /etc/dhcpcd dir that's created during install... (and we all know what
45 happens when Simon says)
47 mv /etc/dhcpcd /etc/dhcpc
49 3. And now for the magic.... by executing /usr/sbin/dhcpcd it automagically
50 sets up your network card without any help from /etc/init.d/ethnet or
51 /etc/sysconfig/network or /etc/sysconfig/network-scripts/ifcfg-eth0
54 Create the /etc/init.d/dhcpcd script containing the following:
57 # Begin /etc/init.d/dhcpcd
59 source /etc/init.d/functions
63 echo -n "Starting DHCP client deamon..."
64 loadproc /usr/sbin/dhcpcd
67 echo -n "Stopping DHCP client deamon..."
68 killproc /usr/sbin/dhcpcd
76 statusproc /usr/sbin/dhcpcd
79 echo "Usage: $0 {start|stop|restart|status}"
84 # End /etc/init.d/dhcpcd
88 chmod 754 /etc/init.d/dhcpcd
91 ln -s ../init.d/dhcpcd K80dhcpcd
93 ln -s ../init.d/dhcpcd K80dhcpcd
95 ln -s ../init.d/dhcpcd K80dhcpcd
97 ln -s ../init.d/dhcpcd S05dhcpcd
99 ln -s ../init.d/dhcpcd S05dhcpcd
101 ln -s ../init.d/dhcpcd S05dhcpcd
103 ln -s ../init.d/dhcpcd K80dhcpcd
105 5. Remove all the ethnet symlinks you can find in the rc?.d directories
107 6. Alas, i still don't know what to do with /etc/hosts. I've noticed
108 that SuSE sets it up like this:
110 127.0.0.1 localhost.localdomain localhost
111 127.0.0.2 <your hostname>.<your domain> <your hostname>
113 Everything seems to be working
115 7. I don't know what else depends on /etc/sysconfig/network (except the
116 network boot scripts) Your ethernet interface doesn't need it anymore ;)
118 8. This is actually a pretty neat way of doing things. after you've
119 run dhcpcd, take a look at ifconfig and route. You should see your setup
120 in a working order if your dhcp server is set up correctly. Now kill
121 the deamon and have another look... you should only see your loopback
122 interface. Pretty nifty...
124 I hope this helps somebody out there ;) My thanks to Simon for the
125 original version of the DHCP hint. Please let me know what you
126 think/suggestions by mailing to thinusp@olienhout.org.za