source: networking/connect/dhcpcd.xml@ 3324c75

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 3324c75 was 3324c75, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Tags

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