source: networking/connect/dhcpcd.xml@ f713df3

11.1 11.2 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 upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since f713df3 was f713df3, checked in by Pierre Labastie <pierre.labastie@…>, 2 years ago

Updates

nghttp2-1.46.0
libinput-1.19.2
dhcpcd-9.4.1
libsoup-2.74.1

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