source: networking/connect/dhcpcd.xml@ b023f19

10.0 10.1 11.0 11.1 9.1 lazarus qt5new trunk upgradedb xry111/intltool xry111/test-20220226
Last change on this file since b023f19 was b023f19, checked in by Douglas R. Reno <renodr@…>, 2 years ago

Pre-reboot tags

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

  • Property mode set to 100644
File size: 13.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY dhcpcd-download-http "https://roy.marples.name/downloads/dhcpcd/dhcpcd-&dhcpcd-version;.tar.xz">
8 <!ENTITY dhcpcd-download-ftp "ftp://roy.marples.name/pub/dhcpcd/dhcpcd-&dhcpcd-version;.tar.xz">
9 <!ENTITY dhcpcd-md5sum "e1eea03388d12c9ad21ecd7c135fdf8b">
10 <!ENTITY dhcpcd-size "224 KB">
11 <!ENTITY dhcpcd-buildsize "2.6 MB (with tests)">
12 <!ENTITY dhcpcd-time "less than 0.1 SBU (with tests)">
13]>
14
15<sect1 id="dhcpcd" xreflabel="dhcpcd-&dhcpcd-version;">
16 <?dbhtml filename="dhcpcd.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>dhcpcd-&dhcpcd-version;</title>
24
25 <indexterm zone="dhcpcd">
26 <primary sortas="a-dhcpcd">dhcpcd</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to dhcpcd</title>
31
32 <para><application>dhcpcd</application> is an implementation of the
33 DHCP client specified in RFC2131. A DHCP client is useful for connecting
34 your computer to a network which uses DHCP to assign network
35 addresses. dhcpcd strives to be a fully featured, yet very lightweight
36 DHCP client.</para>
37
38 &lfs91_checked;
39
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>
61
62 <bridgehead renderas="sect3">dhcpcd Dependencies</bridgehead>
63
64 <bridgehead renderas="sect4">Optional</bridgehead>
65 <para role="optional">
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>
70 </para>
71
72 <para condition="html" role="usernotes">User Notes:
73 <ulink url="&blfs-wiki;/dhcpcd"/></para>
74
75 </sect2>
76
77 <sect2 role="installation">
78 <title>Installation of dhcpcd</title>
79
80 <para>Install <application>dhcpcd</application> by running the following
81 commands:</para>
82
83<screen><userinput>./configure --libexecdir=/lib/dhcpcd \
84 --dbdir=/var/lib/dhcpcd &amp;&amp;
85make</userinput></screen>
86
87 <para>To test the results, issue: <command>make test</command>.</para>
88
89 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
90
91<screen role='root'><userinput>make install</userinput></screen>
92
93<!--
94 <para>By default, a plain text lease info file isn't created but the
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>
98
99<screen role='root'><userinput>sed -i "s;/var/lib;/run;g" dhcpcd-hooks/50-dhcpcd-compat &amp;&amp;
100install -v -m 644 dhcpcd-hooks/50-dhcpcd-compat /lib/dhcpcd/dhcpcd-hooks/</userinput></screen>
101-->
102
103 </sect2>
104
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>
116 <parameter>--dbdir=/var/lib/dhcpcd</parameter>: The default
117 <filename class="directory">/var/db</filename> is not FHS-compliant
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
129 <sect2 role="configuration">
130 <title>Configuring dhcpcd</title>
131
132 <sect3 id="dhcpcd-config">
133 <title>Config Files</title>
134
135 <para><filename>/etc/dhcpcd.conf</filename></para>
136
137 <indexterm zone="dhcpcd dhcpcd-config">
138 <primary sortas="e-etc-dhcpcd-dhcpcd-conf">/etc/dhcpcd/dhcpcd.conf</primary>
139 </indexterm>
140
141 </sect3>
142
143 <sect3 id="dhcpcd-init" revision="sysv">
144 <title>General Configuration Information</title>
145
146 <para>To configure <command>dhcpcd</command>, you need to first install
147 the network service script,
148 <filename>/lib/services/dhcpcd</filename>
149 included in the <xref linkend="bootscripts"/> package
150 (as user <systemitem class="username">root</systemitem>):</para>
151
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
158 <para>Whenever <command>dhcpcd</command> configures or shuts down
159 a network interface, it executes hook scripts. For more details
160 about those scripts, see the <command>dhcpcd-run-hooks</command> and
161 <command>dhcpcd</command> man pages.</para>
162
163 <para id="dhcpcd-config2">Finally, as the <systemitem
164 class="username">root</systemitem> user create the
165 <filename>/etc/sysconfig/ifconfig.eth0</filename>
166 configuration file using the following commands. Adjust appropriately
167 for additional interfaces:</para>
168
169 <indexterm zone="dhcpcd dhcpcd-config2">
170 <primary sortas="e-etc-sysconfig-dhcpcd">/etc/sysconfig/ifconfig.eth0 (dhcpcd)</primary>
171 </indexterm>
172
173<screen role='root'><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
174<literal>ONBOOT="yes"
175IFACE="eth0"
176SERVICE="dhcpcd"
177DHCP_START="-b -q <replaceable>&lt;insert appropriate start options here&gt;</replaceable>"
178DHCP_STOP="-k <replaceable>&lt;insert additional stop options here&gt;</replaceable>"</literal>
179EOF</userinput></screen>
180
181 <para>For more information on the appropriate <envar>DHCP_START</envar> and
182 <envar>DHCP_STOP</envar> values, examine the man page for
183 <command>dhcpcd</command>.</para>
184
185 <note>
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
190 <filename>/etc/ntp.conf</filename>.
191
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>.
195
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
200 <filename>/etc/dhcpcd.conf</filename> file.</para>
201
202 <para>Review the <command>dhcpcd</command> man page for switches to add
203 to the <envar>DHCP_START</envar> value.</para>
204
205 </note>
206
207 <indexterm zone="dhcpcd dhcpcd-config3">
208 <primary sortas="e-etc-resolv.conf">/etc/resolv.conf</primary>
209 </indexterm>
210 </sect3>
211
212 <sect3 id="dhcpcd-init2" revision="sysv">
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
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
238 <filename>/etc/resolv.conf.head</filename> file below as is:</para>
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
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
324 </sect2>
325
326 <sect2 role="content">
327 <title>Contents</title>
328
329 <segmentedlist>
330 <segtitle>Installed Program</segtitle>
331 <segtitle>Installed Library</segtitle>
332 <segtitle>Installed Directory</segtitle>
333
334 <seglistitem>
335 <seg>dhcpcd</seg>
336 <seg>/lib/dhcpcd/dev/udev.so</seg>
337 <seg>/{,var/}lib/dhcpcd and /usr/share/dhcpcd</seg>
338 </seglistitem>
339 </segmentedlist>
340
341 <variablelist>
342 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
343 <?dbfo list-presentation="list"?>
344 <?dbhtml list-presentation="table"?>
345
346 <varlistentry id="dhcpcd-prog">
347 <term><command>dhcpcd</command></term>
348 <listitem>
349 <para>is an implementation of the DHCP client specified
350 in RFC2131.</para>
351 <indexterm zone="dhcpcd dhcpcd-prog">
352 <primary sortas="b-dhcpcd">dhcpcd</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry id="dhcpcd-udev">
358 <term><filename class="libraryfile">udev.so</filename></term>
359 <listitem>
360 <para>
361 adds udev support for interface arrival and departure; this is
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
371 </variablelist>
372
373 </sect2>
374
375</sect1>
Note: See TracBrowser for help on using the repository browser.