source: networking/connect/dhcpcd.xml@ 7241b26

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 7241b26 was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 18 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

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