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@…>, 19 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
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
[820d164a]94 <sect2 role="installation">
[add19ff9]95 <title>Installation of dhcpcd</title>
[820d164a]96
[05c8448]97 <para>
[f8359b8]98 Recent releases of <application>dhcpcd</application> implement privilege
99 separation. Additional installation steps are necessary to set up
[05c8448]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 \
[cb37cb79]110 -s /bin/false \
[05c8448]111 -u 52 dhcpcd &amp;&amp;
112chown -v dhcpcd:dhcpcd /var/lib/dhcpcd </userinput></screen>
113
[d16c71a]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
[7c56ece]119 <para>
120 Install <application>dhcpcd</application> by running the following
121 commands:
122 </para>
[820d164a]123
[e1d2da5]124<screen><userinput>./configure --prefix=/usr \
125 --sysconfdir=/etc \
126 --libexecdir=/usr/lib/dhcpcd \
127 --dbdir=/var/lib/dhcpcd \
[f713df3]128 --runstatedir=/run \
[e1d2da5]129 --privsepuser=dhcpcd &amp;&amp;
[f0740ab]130make</userinput></screen>
[f9a784a]131
[7c56ece]132 <para>
133 To test the results, issue: <command>make test</command>.
134 </para>
[f9a784a]135
[7c56ece]136 <para>
137 Now, as the <systemitem class="username">root</systemitem> user:
138 </para>
[f9a784a]139
[bfa01156]140<screen role='root'><userinput>make install</userinput></screen>
[4839c17]141
[690658a5]142<!--
[7c56ece]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>
[232e46a]149
[bfa01156]150<screen role='root'><userinput>sed -i "s;/var/lib;/run;g" dhcpcd-hooks/50-dhcpcd-compat &amp;&amp;
[f9a784a]151install -v -m 644 dhcpcd-hooks/50-dhcpcd-compat /lib/dhcpcd/dhcpcd-hooks/</userinput></screen>
[690658a5]152-->
[4839c17]153
[820d164a]154 </sect2>
[4839c17]155
[690658a5]156 <sect2 role="commands">
157 <title>Command Explanations</title>
158
159 <para>
[e1d2da5]160 <parameter>--libexecdir=/usr/lib/dhcpcd</parameter>: Set a more proper
161 location for dhcpcd internal libraries.
[690658a5]162 </para>
163
164 <para>
[a3ec5c1]165 <parameter>--dbdir=/var/lib/dhcpcd</parameter>: The default
166 <filename class="directory">/var/db</filename> is not FHS-compliant
[690658a5]167 </para>
168
[f713df3]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
[690658a5]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
[820d164a]184 <sect2 role="configuration">
[add19ff9]185 <title>Configuring dhcpcd</title>
[820d164a]186
187 <sect3 id="dhcpcd-config">
188 <title>Config Files</title>
[4839c17]189
[7c56ece]190 <para>
191 <filename>/etc/dhcpcd.conf</filename>
192 </para>
[4839c17]193
[820d164a]194 <indexterm zone="dhcpcd dhcpcd-config">
[fefa337]195 <primary sortas="e-etc-dhcpcd-dhcpcd-conf">/etc/dhcpcd/dhcpcd.conf</primary>
[820d164a]196 </indexterm>
[4839c17]197
[820d164a]198 </sect3>
199
[3c7bd00]200 <sect3 id="dhcpcd-init" revision="sysv">
[e5f38d6b]201 <title>General Configuration Information</title>
[820d164a]202
[7c56ece]203 <para>
204 To configure <command>dhcpcd</command>, you need to first install
205 the network service script,
[e1d2da5]206 <filename>/usr/lib/services/dhcpcd</filename>
[7c56ece]207 included in the <xref linkend="bootscripts"/> package
208 (as user <systemitem class="username">root</systemitem>):
209 </para>
[4839c17]210
[820d164a]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
[05c8448]217 <note>
218 <para id="dhcpcd-config6">
[e1d2da5]219 the network service script <filename>/usr/lib/services/dhcpcd</filename>
[05c8448]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
[7c56ece]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
[e1d2da5]235 <filename class="directory">/usr/lib/dhcpcd/dhcpcd-hooks</filename>.
[7c56ece]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>
[232e46a]243
[7c56ece]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>
[4839c17]250
[820d164a]251 <indexterm zone="dhcpcd dhcpcd-config2">
[f0740ab]252 <primary sortas="e-etc-sysconfig-dhcpcd">/etc/sysconfig/ifconfig.eth0 (dhcpcd)</primary>
[820d164a]253 </indexterm>
254
[f0740ab]255<screen role='root'><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
[820d164a]256<literal>ONBOOT="yes"
[f0740ab]257IFACE="eth0"
[afa198d]258SERVICE="dhcpcd"
[5aac2b97]259DHCP_START="-b -q <replaceable>&lt;insert appropriate start options here&gt;</replaceable>"
[f0740ab]260DHCP_STOP="-k <replaceable>&lt;insert additional stop options here&gt;</replaceable>"</literal>
[820d164a]261EOF</userinput></screen>
262
[7c56ece]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>
[4839c17]268
[820d164a]269 <indexterm zone="dhcpcd dhcpcd-config3">
270 <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
271 </indexterm>
272 </sect3>
[4839c17]273
[3c7bd00]274 <sect3 id="dhcpcd-init2" revision="sysv">
[e5f38d6b]275 <title>Configuration Information: fixed ip</title>
276
[7c56ece]277 <para id="dhcpcd-config4">
278 Although not usual, it is possible that you need
[e5f38d6b]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
[7c56ece]284 interfaces and for the actual ip and router you need:
285 </para>
[e5f38d6b]286
287 <indexterm zone="dhcpcd dhcpcd-config4">
288 <primary sortas="e-etc-sysconfig-dhcpcd">/etc/sysconfig/ifconfig.eth0 (dhcpcd)</primary>
289 </indexterm>
290
[7c56ece]291<screen role='nodump'><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
[e5f38d6b]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
[7c56ece]299 <para>
300 You can either use DNS servers in
[0840866]301 <filename>/etc/resolv.conf</filename> from another system, your
302 preferred servers, or just the example
[7c56ece]303 <filename>/etc/resolv.conf.head</filename> file below as is:
304 </para>
[e5f38d6b]305
[7c56ece]306<screen role='nodump'><userinput>cat &gt; /etc/resolv.conf.head &lt;&lt; "EOF"
[e5f38d6b]307<literal># OpenDNS servers
308nameserver 208.67.222.222
309nameserver 208.67.220.220</literal>
310EOF</userinput></screen>
311
312 </sect3>
313
[138bdf6]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>
[7c56ece]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>
[138bdf6]345 </note>
346
347 <indexterm zone="dhcpcd dhcpcd-config5">
348 <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
349 </indexterm>
350
[7c56ece]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>
[138bdf6]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
[820d164a]382 </sect2>
[4839c17]383
[820d164a]384 <sect2 role="content">
385 <title>Contents</title>
386
387 <segmentedlist>
388 <segtitle>Installed Program</segtitle>
[d81eda8]389 <segtitle>Installed Library</segtitle>
[b1d305ed]390 <segtitle>Installed Directory</segtitle>
[4839c17]391
[820d164a]392 <seglistitem>
393 <seg>dhcpcd</seg>
[e1d2da5]394 <seg>/usr/lib/dhcpcd/dev/udev.so</seg>
395 <seg>/{usr,var}/lib/dhcpcd and /usr/share/dhcpcd</seg>
[820d164a]396 </seglistitem>
397 </segmentedlist>
[4839c17]398
[820d164a]399 <variablelist>
400 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
401 <?dbfo list-presentation="list"?>
402 <?dbhtml list-presentation="table"?>
[4839c17]403
[820d164a]404 <varlistentry id="dhcpcd-prog">
405 <term><command>dhcpcd</command></term>
406 <listitem>
[7c56ece]407 <para>
[4c24eb0a]408 is an implementation of the DHCP client specified in RFC2131
[7c56ece]409 </para>
[820d164a]410 <indexterm zone="dhcpcd dhcpcd-prog">
411 <primary sortas="b-dhcpcd">dhcpcd</primary>
412 </indexterm>
413 </listitem>
414 </varlistentry>
[4839c17]415
[81f1de4]416 <varlistentry id="dhcpcd-udev">
417 <term><filename class="libraryfile">udev.so</filename></term>
418 <listitem>
419 <para>
[c93c9bf4]420 adds udev support for interface arrival and departure; this is
[81f1de4]421 because udev likes to rename the interface, which it can't do if
[4c24eb0a]422 dhcpcd grabs it first
[81f1de4]423 </para>
424 <indexterm zone="dhcpcd dhcpcd-udev">
425 <primary sortas="c-dhcpcd-udev">udev.so</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
[820d164a]430 </variablelist>
431
432 </sect2>
[f45b1953]433
434</sect1>
Note: See TracBrowser for help on using the repository browser.