source: networking/connect/dhcpcd.xml@ 012ec62

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.0 9.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 012ec62 was 012ec62, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Update to openldap-2.4.48.
Update to dhcpcd-8.0.1.
Update to xapian-core-1.4.12.
Update to libdazzle-3.32.3.
Update to whois-5.5.0.

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

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