1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY dhcpcd-download-http "https://roy.marples.name/downloads/dhcpcd/dhcpcd-&dhcpcd-version;.tar.xz">
|
---|
8 | <!ENTITY dhcpcd-download-ftp "ftp://roy.marples.name/pub/dhcpcd/dhcpcd-&dhcpcd-version;.tar.xz">
|
---|
9 | <!ENTITY dhcpcd-md5sum "dd77711cf3232002bb075f5210269f88">
|
---|
10 | <!ENTITY dhcpcd-size "244 KB">
|
---|
11 | <!ENTITY dhcpcd-buildsize "3.5 MB (with tests)">
|
---|
12 | <!ENTITY dhcpcd-time "less than 0.1 SBU (with tests)">
|
---|
13 | ]>
|
---|
14 | <!--
|
---|
15 | Use this URL as ChangeLog:
|
---|
16 | https://roy.marples.name/blog/dhcpcd-9-1-0-released.html
|
---|
17 | Substitute the 9-1-0 with 9-1-1 or 9-1-2 ...
|
---|
18 | -->
|
---|
19 |
|
---|
20 | <sect1 id="dhcpcd" xreflabel="dhcpcd-&dhcpcd-version;">
|
---|
21 | <?dbhtml filename="dhcpcd.html"?>
|
---|
22 |
|
---|
23 | <sect1info>
|
---|
24 | <othername>$LastChangedBy$</othername>
|
---|
25 | <date>$Date$</date>
|
---|
26 | </sect1info>
|
---|
27 |
|
---|
28 | <title>dhcpcd-&dhcpcd-version;</title>
|
---|
29 |
|
---|
30 | <indexterm zone="dhcpcd">
|
---|
31 | <primary sortas="a-dhcpcd">dhcpcd</primary>
|
---|
32 | </indexterm>
|
---|
33 |
|
---|
34 | <sect2 role="package">
|
---|
35 | <title>Introduction to dhcpcd</title>
|
---|
36 |
|
---|
37 | <para>
|
---|
38 | <application>dhcpcd</application> is an implementation of the
|
---|
39 | DHCP client specified in RFC2131. A DHCP client is useful for connecting
|
---|
40 | your computer to a network which uses DHCP to assign network
|
---|
41 | addresses. dhcpcd strives to be a fully featured, yet very lightweight
|
---|
42 | DHCP client.
|
---|
43 | </para>
|
---|
44 |
|
---|
45 | &lfs91_checked;
|
---|
46 |
|
---|
47 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
48 | <itemizedlist spacing="compact">
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download (HTTP): <ulink url="&dhcpcd-download-http;"/>
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download (FTP): <ulink url="&dhcpcd-download-ftp;"/>
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download MD5 sum: &dhcpcd-md5sum;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Download size: &dhcpcd-size;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated disk space required: &dhcpcd-buildsize;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | <listitem>
|
---|
75 | <para>
|
---|
76 | Estimated build time: &dhcpcd-time;
|
---|
77 | </para>
|
---|
78 | </listitem>
|
---|
79 | </itemizedlist>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect3">dhcpcd Dependencies</bridgehead>
|
---|
82 |
|
---|
83 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
84 | <para role="optional">
|
---|
85 | <xref linkend="llvm"/> (with Clang),
|
---|
86 | <xref linkend="ntp"/>,
|
---|
87 | <ulink url="https://chrony.tuxfamily.org/">chronyd</ulink>, and
|
---|
88 | <ulink url="https://github.com/thkukuk/ypbind-mt/">ypbind</ulink>
|
---|
89 | </para>
|
---|
90 |
|
---|
91 | <para condition="html" role="usernotes">User Notes:
|
---|
92 | <ulink url="&blfs-wiki;/dhcpcd"/></para>
|
---|
93 |
|
---|
94 | </sect2>
|
---|
95 |
|
---|
96 | <sect2 role="installation">
|
---|
97 | <title>Installation of dhcpcd</title>
|
---|
98 |
|
---|
99 | <para>
|
---|
100 | Recent releases of <application>dhcpcd</application> implement privilege
|
---|
101 | separation. Additional installation steps are necessary to set up
|
---|
102 | the proper environment, which are performed by issuing the following
|
---|
103 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
104 | </para>
|
---|
105 |
|
---|
106 | <screen role="root"><userinput>install -v -m700 -d /var/lib/dhcpcd &&
|
---|
107 |
|
---|
108 | groupadd -g 52 dhcpcd &&
|
---|
109 | useradd -c 'dhcpcd PrivSep' \
|
---|
110 | -d /var/lib/dhcpcd \
|
---|
111 | -g dhcpcd \
|
---|
112 | -s /bin/false \
|
---|
113 | -u 52 dhcpcd &&
|
---|
114 | chown -v dhcpcd:dhcpcd /var/lib/dhcpcd </userinput></screen>
|
---|
115 |
|
---|
116 | <para>
|
---|
117 | Install <application>dhcpcd</application> by running the following
|
---|
118 | commands:
|
---|
119 | </para>
|
---|
120 |
|
---|
121 | <screen><userinput>./configure --libexecdir=/lib/dhcpcd \
|
---|
122 | --dbdir=/var/lib/dhcpcd \
|
---|
123 | --privsepuser=dhcpcd &&
|
---|
124 | make</userinput></screen>
|
---|
125 |
|
---|
126 | <para>
|
---|
127 | To test the results, issue: <command>make test</command>.
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <para>
|
---|
131 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
132 | </para>
|
---|
133 |
|
---|
134 | <screen role='root'><userinput>make install</userinput></screen>
|
---|
135 |
|
---|
136 | <!--
|
---|
137 | <para>
|
---|
138 | By default, a plain text lease info file isn't created but the
|
---|
139 | <application>dhcpcd</application> provides a hook which can be used for
|
---|
140 | creating such a file. Install the hook by running the following commands
|
---|
141 | as the <systemitem class="username">root</systemitem> user:
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | <screen role='root'><userinput>sed -i "s;/var/lib;/run;g" dhcpcd-hooks/50-dhcpcd-compat &&
|
---|
145 | install -v -m 644 dhcpcd-hooks/50-dhcpcd-compat /lib/dhcpcd/dhcpcd-hooks/</userinput></screen>
|
---|
146 | -->
|
---|
147 |
|
---|
148 | </sect2>
|
---|
149 |
|
---|
150 | <sect2 role="commands">
|
---|
151 | <title>Command Explanations</title>
|
---|
152 |
|
---|
153 | <para>
|
---|
154 | <parameter>--libexecdir=/lib/dhcpcd</parameter>: The default
|
---|
155 | <filename class="directory">/libexec</filename> is not FHS-compliant.
|
---|
156 | Since this directory may need to be available early in the boot,
|
---|
157 | <filename class="directory">/usr/libexec</filename> cannot be used either.
|
---|
158 | </para>
|
---|
159 |
|
---|
160 | <para>
|
---|
161 | <parameter>--dbdir=/var/lib/dhcpcd</parameter>: The default
|
---|
162 | <filename class="directory">/var/db</filename> is not FHS-compliant
|
---|
163 | </para>
|
---|
164 |
|
---|
165 | <para>
|
---|
166 | <option>--with-hook=...</option>: You can optionally install more hooks,
|
---|
167 | for example to install some configuration files such as
|
---|
168 | <filename>ntp.conf</filename>. The set of hooks is in the
|
---|
169 | <filename class="directory">dhcpcd-hooks</filename> directory in the
|
---|
170 | build tree.
|
---|
171 | </para>
|
---|
172 | </sect2>
|
---|
173 |
|
---|
174 | <sect2 role="configuration">
|
---|
175 | <title>Configuring dhcpcd</title>
|
---|
176 |
|
---|
177 | <sect3 id="dhcpcd-config">
|
---|
178 | <title>Config Files</title>
|
---|
179 |
|
---|
180 | <para>
|
---|
181 | <filename>/etc/dhcpcd.conf</filename>
|
---|
182 | </para>
|
---|
183 |
|
---|
184 | <indexterm zone="dhcpcd dhcpcd-config">
|
---|
185 | <primary sortas="e-etc-dhcpcd-dhcpcd-conf">/etc/dhcpcd/dhcpcd.conf</primary>
|
---|
186 | </indexterm>
|
---|
187 |
|
---|
188 | </sect3>
|
---|
189 |
|
---|
190 | <sect3 id="dhcpcd-init" revision="sysv">
|
---|
191 | <title>General Configuration Information</title>
|
---|
192 |
|
---|
193 | <para>
|
---|
194 | To configure <command>dhcpcd</command>, you need to first install
|
---|
195 | the network service script,
|
---|
196 | <filename>/lib/services/dhcpcd</filename>
|
---|
197 | included in the <xref linkend="bootscripts"/> package
|
---|
198 | (as user <systemitem class="username">root</systemitem>):
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | <indexterm zone="dhcpcd dhcpcd-init">
|
---|
202 | <primary sortas="f-dhcpcd">dhcpcd (service script)</primary>
|
---|
203 | </indexterm>
|
---|
204 |
|
---|
205 | <screen role='root'><userinput>make install-service-dhcpcd</userinput></screen>
|
---|
206 |
|
---|
207 | <note>
|
---|
208 | <para id="dhcpcd-config6">
|
---|
209 | the network service script <filename>/lib/services/dhcpcd</filename>
|
---|
210 | contained in bootscripts up to blfs-bootscripts-20191204 is
|
---|
211 | not compatible with latest dhcpcd, as the location of the pidfile
|
---|
212 | changed.
|
---|
213 | To work around this, issue the following command:
|
---|
214 |
|
---|
215 | <screen role='root'><userinput>sed -i "s;/run/dhcpcd-;/run/dhcpcd/;g" /lib/services/dhcpcd</userinput></screen>
|
---|
216 | </para>
|
---|
217 | </note>
|
---|
218 |
|
---|
219 | <note>
|
---|
220 | <para id="dhcpcd-config3">
|
---|
221 | The default for <command>dhcpcd</command> is to set the hostname
|
---|
222 | and mtu. It also overwrites <filename>/etc/resolv.conf </filename>
|
---|
223 | and <filename>/etc/ntp.conf</filename>. These
|
---|
224 | modifications to system files are done by hooks which are stored in
|
---|
225 | <filename class="directory">/lib/dhcpcd/dhcpcd-hooks</filename>.
|
---|
226 | Setup <command>dhcpcd</command> by removing or adding hooks from/to
|
---|
227 | that directory. The execution of hooks can be disabled by using
|
---|
228 | the <option>--nohook</option> (<option>-C</option>) command line
|
---|
229 | option or by the <option>nohook</option> option in the
|
---|
230 | <filename>/etc/dhcpcd.conf</filename> file.
|
---|
231 | </para>
|
---|
232 | </note>
|
---|
233 |
|
---|
234 | <para id="dhcpcd-config2">
|
---|
235 | Finally, as the <systemitem class="username">root</systemitem> user
|
---|
236 | create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
|
---|
237 | configuration file using the following commands. Adjust appropriately
|
---|
238 | for additional interfaces:
|
---|
239 | </para>
|
---|
240 |
|
---|
241 | <indexterm zone="dhcpcd dhcpcd-config2">
|
---|
242 | <primary sortas="e-etc-sysconfig-dhcpcd">/etc/sysconfig/ifconfig.eth0 (dhcpcd)</primary>
|
---|
243 | </indexterm>
|
---|
244 |
|
---|
245 | <screen role='root'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
---|
246 | <literal>ONBOOT="yes"
|
---|
247 | IFACE="eth0"
|
---|
248 | SERVICE="dhcpcd"
|
---|
249 | DHCP_START="-b -q <replaceable><insert appropriate start options here></replaceable>"
|
---|
250 | DHCP_STOP="-k <replaceable><insert additional stop options here></replaceable>"</literal>
|
---|
251 | EOF</userinput></screen>
|
---|
252 |
|
---|
253 | <para>
|
---|
254 | For more information on the appropriate <envar>DHCP_START</envar> and
|
---|
255 | <envar>DHCP_STOP</envar> values, examine the man page for
|
---|
256 | <command>dhcpcd</command>.
|
---|
257 | </para>
|
---|
258 |
|
---|
259 | <indexterm zone="dhcpcd dhcpcd-config3">
|
---|
260 | <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
|
---|
261 | </indexterm>
|
---|
262 | </sect3>
|
---|
263 |
|
---|
264 | <sect3 id="dhcpcd-init2" revision="sysv">
|
---|
265 | <title>Configuration Information: fixed ip</title>
|
---|
266 |
|
---|
267 | <para id="dhcpcd-config4">
|
---|
268 | Although not usual, it is possible that you need
|
---|
269 | to configure <application>dhcpcd</application> to use a fixed ip. Here,
|
---|
270 | we give an example. As the
|
---|
271 | <systemitem class="username">root</systemitem> user create the
|
---|
272 | <filename>/etc/sysconfig/ifconfig.eth0</filename> configuration file
|
---|
273 | using the following commands. Adjust appropriately for additional
|
---|
274 | interfaces and for the actual ip and router you need:
|
---|
275 | </para>
|
---|
276 |
|
---|
277 | <indexterm zone="dhcpcd dhcpcd-config4">
|
---|
278 | <primary sortas="e-etc-sysconfig-dhcpcd">/etc/sysconfig/ifconfig.eth0 (dhcpcd)</primary>
|
---|
279 | </indexterm>
|
---|
280 |
|
---|
281 | <screen role='nodump'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
---|
282 | <literal>ONBOOT="yes"
|
---|
283 | IFACE="eth0"
|
---|
284 | SERVICE="dhcpcd"
|
---|
285 | DHCP_START="-b -q -S ip_address=192.168.0.10/24 -S routers=192.168.0.1"
|
---|
286 | DHCP_STOP="-k"</literal>
|
---|
287 | EOF</userinput></screen>
|
---|
288 |
|
---|
289 | <para>
|
---|
290 | You can either use DNS servers in
|
---|
291 | <filename>/etc/resolv.conf</filename> from another system, your
|
---|
292 | preferred servers, or just the example
|
---|
293 | <filename>/etc/resolv.conf.head</filename> file below as is:
|
---|
294 | </para>
|
---|
295 |
|
---|
296 | <screen role='nodump'><userinput>cat > /etc/resolv.conf.head << "EOF"
|
---|
297 | <literal># OpenDNS servers
|
---|
298 | nameserver 208.67.222.222
|
---|
299 | nameserver 208.67.220.220</literal>
|
---|
300 | EOF</userinput></screen>
|
---|
301 |
|
---|
302 | </sect3>
|
---|
303 |
|
---|
304 | <sect3 id="dhcpcd-init3" revision="systemd">
|
---|
305 | <title>General Configuration Information</title>
|
---|
306 |
|
---|
307 | <para>
|
---|
308 | If you want to configure network interfaces at boot using
|
---|
309 | <command>dhcpcd</command>, you need to install the
|
---|
310 | systemd unit included in <xref linkend="systemd-units"/>
|
---|
311 | package by running the following command as the
|
---|
312 | <systemitem class="username">root</systemitem> user:
|
---|
313 | </para>
|
---|
314 |
|
---|
315 | <screen role="root"><userinput>make install-dhcpcd</userinput></screen>
|
---|
316 |
|
---|
317 | <indexterm zone="dhcpcd dhcpcd-init3">
|
---|
318 | <primary sortas="f-dhcpcd">dhcpcd</primary>
|
---|
319 | </indexterm>
|
---|
320 |
|
---|
321 | <note>
|
---|
322 | <para id="dhcpcd-config5">
|
---|
323 | The default behavior of <command>dhcpcd</command> is to set the
|
---|
324 | hostname and the mtu. It also overwrites <filename>/etc/resolv.conf
|
---|
325 | </filename> and <filename>/etc/ntp.conf</filename>. These
|
---|
326 | modifications to system configuration files are done by hooks which
|
---|
327 | are stored in <filename class="directory">
|
---|
328 | /lib/dhcpcd/dhcpcd-hooks</filename>. Setup <command>dhcpcd</command>
|
---|
329 | by removing or adding hooks from/to that directory. The execution
|
---|
330 | of hooks can be disabled by using the <option>--nohook</option>
|
---|
331 | (<option>-C</option>) command line option or by the
|
---|
332 | <option>nohook</option> option in the <filename>/etc/dhcpcd.conf
|
---|
333 | </filename> file.
|
---|
334 | </para>
|
---|
335 | </note>
|
---|
336 |
|
---|
337 | <indexterm zone="dhcpcd dhcpcd-config5">
|
---|
338 | <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
|
---|
339 | </indexterm>
|
---|
340 |
|
---|
341 | <note>
|
---|
342 | <para>
|
---|
343 | Make sure that you disable the <command>systemd-networkd</command>
|
---|
344 | service or configure it not to manage the interfaces you want to
|
---|
345 | manage with <application>dhcpcd</application>.
|
---|
346 | </para>
|
---|
347 | </note>
|
---|
348 |
|
---|
349 | <para>
|
---|
350 | At this point you can test if <command>dhcpcd</command> is
|
---|
351 | behaving as expected by running the following command as the
|
---|
352 | <systemitem class="username">root</systemitem> user:
|
---|
353 | </para>
|
---|
354 |
|
---|
355 | <screen role="root"><userinput>systemctl start dhcpcd@<replaceable>eth0</replaceable></userinput></screen>
|
---|
356 |
|
---|
357 | <para>
|
---|
358 | To start <command>dhcpcd</command> on a specific interface
|
---|
359 | at boot, enable the previously installed systemd unit by
|
---|
360 | running the following command as the
|
---|
361 | <systemitem class="username">root</systemitem> user:
|
---|
362 | </para>
|
---|
363 |
|
---|
364 | <screen role="root"><userinput>systemctl enable dhcpcd@<replaceable>eth0</replaceable></userinput></screen>
|
---|
365 |
|
---|
366 | <para>
|
---|
367 | Replace <replaceable>eth0</replaceable> with the actual interface name.
|
---|
368 | </para>
|
---|
369 |
|
---|
370 | </sect3>
|
---|
371 |
|
---|
372 | </sect2>
|
---|
373 |
|
---|
374 | <sect2 role="content">
|
---|
375 | <title>Contents</title>
|
---|
376 |
|
---|
377 | <segmentedlist>
|
---|
378 | <segtitle>Installed Program</segtitle>
|
---|
379 | <segtitle>Installed Library</segtitle>
|
---|
380 | <segtitle>Installed Directory</segtitle>
|
---|
381 |
|
---|
382 | <seglistitem>
|
---|
383 | <seg>dhcpcd</seg>
|
---|
384 | <seg>/lib/dhcpcd/dev/udev.so</seg>
|
---|
385 | <seg>/{,var/}lib/dhcpcd and /usr/share/dhcpcd</seg>
|
---|
386 | </seglistitem>
|
---|
387 | </segmentedlist>
|
---|
388 |
|
---|
389 | <variablelist>
|
---|
390 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
391 | <?dbfo list-presentation="list"?>
|
---|
392 | <?dbhtml list-presentation="table"?>
|
---|
393 |
|
---|
394 | <varlistentry id="dhcpcd-prog">
|
---|
395 | <term><command>dhcpcd</command></term>
|
---|
396 | <listitem>
|
---|
397 | <para>
|
---|
398 | is an implementation of the DHCP client specified in RFC2131.
|
---|
399 | </para>
|
---|
400 | <indexterm zone="dhcpcd dhcpcd-prog">
|
---|
401 | <primary sortas="b-dhcpcd">dhcpcd</primary>
|
---|
402 | </indexterm>
|
---|
403 | </listitem>
|
---|
404 | </varlistentry>
|
---|
405 |
|
---|
406 | <varlistentry id="dhcpcd-udev">
|
---|
407 | <term><filename class="libraryfile">udev.so</filename></term>
|
---|
408 | <listitem>
|
---|
409 | <para>
|
---|
410 | adds udev support for interface arrival and departure; this is
|
---|
411 | because udev likes to rename the interface, which it can't do if
|
---|
412 | dhcpcd grabs it first.
|
---|
413 | </para>
|
---|
414 | <indexterm zone="dhcpcd dhcpcd-udev">
|
---|
415 | <primary sortas="c-dhcpcd-udev">udev.so</primary>
|
---|
416 | </indexterm>
|
---|
417 | </listitem>
|
---|
418 | </varlistentry>
|
---|
419 |
|
---|
420 | </variablelist>
|
---|
421 |
|
---|
422 | </sect2>
|
---|
423 |
|
---|
424 | </sect1>
|
---|