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