source: networking/connect/dhcpcd.xml@ 22062586

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 bdubbs/svn 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 22062586 was fa4a8d5, checked in by Thomas Trepl <thomas@…>, 6 years ago

Update to dhcpcd-7.0.8

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

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