source: networking/connect/dhcpcd.xml@ 2b2ddc17

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 2b2ddc17 was bb4b217d, checked in by Douglas R. Reno <renodr@…>, 18 months ago

Typo fixes from rhubarbpieguy

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