source: networking/connect/dhcpcd.xml@ 14bd41d

11.3 12.0 12.1 12.2 gimp3 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/for-12.3 xry111/llvm18 xry111/spidermonkey128 xry111/xf86-video-removal
Last change on this file since 14bd41d was cb37cb79, checked in by Bruce Dubbs <bdubbs@…>, 23 months ago

Update to cmake-3.24.3.

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