source: networking/connect/dhcpcd.xml@ ca783379

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 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ca783379 was 453910f, checked in by Douglas R. Reno <renodr@…>, 2 years ago

Initial round of tags from me

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