source: networking/connect/dhcpcd.xml@ 05c8448

10.0 10.1 11.0 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 05c8448 was 05c8448, checked in by Tim Tassonis <stuff@…>, 4 years ago

Update to dhcpcd-9.0.0.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22947 af4574ff-66df-0310-9fd7-8a98e5e911e0

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