source: networking/connect/dhcp.xml@ 7241b26

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/llvm18 xry111/xf86-video-removal
Last change on this file since 7241b26 was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 18 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

  • Property mode set to 100644
File size: 18.6 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 dhcp-download-http "https://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
8 <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
9 <!ENTITY dhcp-md5sum "36c6ca77212373b0cff478ae9e5d32af">
10 <!ENTITY dhcp-size "9.6 MB">
11 <!ENTITY dhcp-buildsize "199 MB">
12 <!ENTITY dhcp-time "0.7 SBU">
13]>
14
15<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
16 <?dbhtml filename="dhcp.html"?>
17
18
19 <title>DHCP-&dhcp-version;</title>
20
21 <indexterm zone="dhcp">
22 <primary sortas="a-DHCP">DHCP</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to ISC DHCP</title>
27
28 <para>
29 The <application>ISC DHCP</application> package contains both the client
30 and server programs for DHCP. <command>dhclient</command> (the client) is
31 used for connecting to a network which uses DHCP to assign network
32 addresses. <command>dhcpd</command> (the server) is used for assigning
33 network addresses on private networks.
34 </para>
35
36 &lfs112_checked;
37
38 <bridgehead renderas="sect3">Package Information</bridgehead>
39 <itemizedlist spacing="compact">
40 <listitem>
41 <para>
42 Download (HTTP): <ulink url="&dhcp-download-http;"/>
43 </para>
44 </listitem>
45 <listitem>
46 <para>
47 Download (FTP): <ulink url="&dhcp-download-ftp;"/>
48 </para>
49 </listitem>
50 <listitem>
51 <para>
52 Download MD5 sum: &dhcp-md5sum;
53 </para>
54 </listitem>
55 <listitem>
56 <para>
57 Download size: &dhcp-size;
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Estimated disk space required: &dhcp-buildsize;
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Estimated build time: &dhcp-time;
68 </para>
69 </listitem>
70 </itemizedlist>
71<!--
72 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
73 <itemizedlist spacing="compact">
74 <listitem>
75 <para>
76 Required patch:
77 <ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
78 </para>
79 </listitem>
80 <listitem>
81 <para>
82 Optional patch:
83 <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
84 </para>
85 </listitem>
86 </itemizedlist>
87-->
88 <para condition="html" role="usernotes">User Notes:
89 <ulink url="&blfs-wiki;/dhcp"/>
90 </para>
91 </sect2>
92
93 <sect2 role="kernel" id="dhcp-kernel">
94 <title>Kernel Configuration</title>
95
96 <para>
97 You must have Packet Socket support. IPv6 support is optional.
98 </para>
99
100<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
101 Networking options ---&gt;
102 &lt;*&gt; Packet socket [CONFIG_PACKET]
103 &lt;*&gt; The IPv6 Protocol ---&gt; [CONFIG_IPV6]</literal></screen>
104<!--
105 <para>
106 If you do not have IPv6 support:
107 </para>
108
109<screen><literal>[*] Networking support - - -&gt; [CONFIG_NET]
110 Networking Options - - -&gt;
111 &lt;*&gt; The IPv6 Protocol - - -&gt; [CONFIG_IPV6]</literal></screen>
112
113 <para>
114 compiled in, then you must use the <quote>missing_ipv6</quote> patch.
115 </para>
116-->
117 <indexterm zone="dhcp dhcp-kernel">
118 <primary sortas="d-DHCP">DHCP</primary>
119 </indexterm>
120
121 </sect2>
122
123 <sect2 role="installation">
124 <title>Installation of ISC DHCP</title>
125
126<!-- Not needed when building DHCP-4.4.3.
127 <para>
128 First, fix a build issue with GCC 10 and later:
129 </para>
130
131<screen><userinput>sed -i '/o.*dhcp_type/d' server/mdb.c &amp;&amp;
132sed -r '/u.*(local|remote)_port/d' \
133 -i client/dhclient.c \
134 relay/dhcrelay.c</userinput></screen>
135-->
136 <note>
137 <para>
138 This package does not support parallel build.
139 </para>
140 </note>
141<!-- This should not be needed any more. Visual check appears to handle it.
142 <para>
143 If you have not compiled IPv6 support into the kernel, apply the
144 missing_ipv6 patch:
145 </para>
146
147<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
148-->
149 <note>
150 <para>
151 Be careful with the instructions below. The single and
152 double quotes are important because the defined
153 variables are used verbatim in the code.
154 </para>
155 </note>
156
157 <para>
158 Install <application>ISC DHCP</application> by running
159 the following commands:
160 </para>
161
162<!--
163 Running ( export CFLAGS=... ./configure ... ) in a subshell
164 preserves CFLAGS if they are set in environment
165-->
166<screen><userinput>( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \
167 -D_PATH_DHCLIENT_SCRIPT='\"/usr/sbin/dhclient-script\"' \
168 -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
169 -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &amp;&amp;
170
171./configure --prefix=/usr \
172 --sysconfdir=/etc/dhcp \
173 --localstatedir=/var \
174 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
175 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
176 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
177 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
178) &amp;&amp;
179make -j1</userinput></screen>
180
181 <para>
182 <!-- Note: make check builds a library, but otherwise does nothing. -->
183 This package does not come with a test suite.
184 </para>
185
186 <para>
187 If you only want to install the <application>ISC DHCP</application> client,
188 issue the following commands as the
189 <systemitem class="username">root</systemitem> user:
190 </para>
191
192<screen role="root"><userinput>make -C client install &amp;&amp;
193install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
194
195 <para>
196 Skip to <xref linkend="dhclient-config"/> in order to configure the
197 client
198 </para>
199
200 <para>
201 If you only want to install the <application>ISC DHCP</application> server,
202 issue the following command as the
203 <systemitem class="username">root</systemitem> user:
204 </para>
205
206<screen role="root"><userinput>make -C server install</userinput></screen>
207
208 <para>
209 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
210 </para>
211
212 <para>
213 Alternatively, you can install whole package which includes the client,
214 server, relay, static libraries and development headers by running the
215 following commands as the
216 <systemitem class="username">root</systemitem> user:
217 </para>
218
219<screen role="root"><userinput>make install &amp;&amp;
220install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
221
222 </sect2>
223
224 <sect2 role="configuration">
225 <title>Configuring ISC DHCP</title>
226
227 <sect3 id="dhcp-config">
228 <title>Config Files</title>
229
230 <para>
231 <filename>/etc/dhcp/dhclient.conf</filename> and
232 <filename>/etc/dhcp/dhcpd.conf</filename>
233 </para>
234
235 <indexterm zone="dhcp dhcp-config">
236 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
237 </indexterm>
238
239 <indexterm zone="dhcp dhcp-config">
240 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
241 </indexterm>
242
243 </sect3>
244
245 <sect3 id="dhclient-config">
246 <title>Client Configuration</title>
247
248 <para>
249 Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
250 by running the following command as the
251 <systemitem class="username">root</systemitem> user:
252 </para>
253
254<screen role="root"><userinput>install -vdm755 /etc/dhcp &amp;&amp;
255cat &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
256<literal># Begin /etc/dhcp/dhclient.conf
257#
258# Basic dhclient.conf(5)
259
260#prepend domain-name-servers 127.0.0.1;
261request subnet-mask, broadcast-address, time-offset, routers,
262 domain-name, domain-name-servers, domain-search, host-name,
263 netbios-name-servers, netbios-scope, interface-mtu,
264 ntp-servers;
265require subnet-mask, domain-name-servers;
266#timeout 60;
267#retry 60;
268#reboot 10;
269#select-timeout 5;
270#initial-interval 2;
271
272# End /etc/dhcp/dhclient.conf</literal>
273EOF</userinput></screen>
274
275 <para>
276 See <command>man 5 dhclient.conf</command> for additional options.
277 </para>
278
279 <para>
280 Now create the <filename class="directory">/var/lib/dhclient</filename>
281 directory which will contain DHCP Client leases by running the following
282 command as the <systemitem class="username">root</systemitem> user:
283 </para>
284
285<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
286
287 <para id="dhclient-service-sysd" revision="systemd">
288 If you want to configure network interfaces at boot using
289 <command>dhclient</command>, you need to install the
290 <filename>dhclient@.service</filename> unit included in the
291 <xref linkend="systemd-units"/> package by running the following
292 command as the <systemitem class="username">root</systemitem> user:
293 </para>
294
295 <indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
296 <primary sortas="f-dhclient">dhclient@.service</primary>
297 </indexterm>
298
299<screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
300
301 <note revision="systemd">
302 <para>
303 Make sure that you disable the <command>systemd-networkd</command>
304 service or configure it not to manage the interfaces you want to
305 manage with <command>dhclient</command>.
306 </para>
307 </note>
308
309 <para>
310 At this point you can test if <command>dhclient</command> is
311 behaving as expected by running the following command as the
312 <systemitem class="username">root</systemitem> user:
313 </para>
314
315<screen role="root"
316 remap="test"
317 revision="sysv"><userinput>dhclient <replaceable>&lt;eth0&gt;</replaceable></userinput></screen>
318
319<screen role="root"
320 remap="test"
321 revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
322
323 <para revision="sysv">
324 Replace <replaceable>&lt;eth0&gt;</replaceable> with your
325 desired interface. If you want more verbose output, add the
326 <command>-v</command> parameter to the command above.
327 </para>
328
329 <para id="dhclient-service" revision="sysv">
330 If you want to configure network interfaces at boot using
331 <command>dhclient</command>, you need to install the
332 <filename>/lib/services/dhclient</filename> script
333 included in <xref linkend="bootscripts"/> package:
334 </para>
335
336<screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
337
338 <indexterm zone="dhcp dhclient-service" revision="sysv">
339 <primary sortas="f-dhclient">dhclient (service script)</primary>
340 </indexterm>
341
342 <para id="dhclient-ifconfig" revision="sysv">
343 Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
344 configuration file with the following commands as the
345 <systemitem class="username">root</systemitem> user:
346 </para>
347
348<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
349<literal>ONBOOT="yes"
350IFACE="eth0"
351SERVICE="dhclient"
352DHCP_START=""
353DHCP_STOP=""
354
355# Set PRINTIP="yes" to have the script print
356# the DHCP assigned IP address
357PRINTIP="no"
358
359# Set PRINTALL="yes" to print the DHCP assigned values for
360# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
361PRINTALL="no"</literal>
362EOF</userinput></screen>
363
364 <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
365 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
366 </indexterm>
367
368 <para revision="sysv">
369 Adjust the file to suit your needs.
370 </para>
371
372 <para revision="sysv">
373 For more information on the appropriate <envar>DHCP_START</envar>
374 and <envar>DHCP_STOP</envar> values see
375 <command>man 8 dhclient</command>.
376 </para>
377
378 <para revision="systemd">
379 To start <command>dhclient</command> on a specific interface
380 at boot, enable the previously installed systemd unit by
381 running the following command as the
382 <systemitem class="username">root</systemitem> user:
383 </para>
384
385<screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
386
387 <para revision="systemd">
388 Replace <replaceable>eth0</replaceable> with the actual interface name.
389 </para>
390
391 </sect3>
392
393 <sect3 id="dhcpd-config">
394 <title>Server Configuration</title>
395
396 <para>
397 Note that you only need the DHCP server if you want to issue
398 LAN addresses over your network. The DHCP client doesn't need
399 the server in order to function properly.
400 </para>
401
402 <para>
403 Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
404 by running the following command as the
405 <systemitem class="username">root</systemitem> user:
406 </para>
407
408<screen role="root"><userinput>cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; "EOF"
409<literal># Begin /etc/dhcp/dhcpd.conf
410#
411# Example dhcpd.conf(5)
412
413# Use this to enable / disable dynamic dns updates globally.
414ddns-update-style none;
415
416# option definitions common to all supported networks...
417option domain-name "example.org";
418option domain-name-servers ns1.example.org, ns2.example.org;
419
420default-lease-time 600;
421max-lease-time 7200;
422
423# This is a very basic subnet declaration.
424subnet 10.254.239.0 netmask 255.255.255.224 {
425 range 10.254.239.10 10.254.239.20;
426 option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
427}
428
429# End /etc/dhcp/dhcpd.conf</literal>
430EOF</userinput></screen>
431
432 <para>
433 Adjust the file to suit your needs. See
434 <command>man 5 dhcpd.conf</command> for additional options.
435 </para>
436
437<!-- the "touch..." is needed according to dhcpd.leases(5) -->
438 <para>
439 Now create the <filename>/var/lib/dhcpd/dhcpd.leases</filename>
440 directory which will contain DHCP Server leases by running the following
441 commands as the <systemitem class="username">root</systemitem> user:
442 </para>
443
444<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd &amp;&amp;
445touch /var/lib/dhcpd/dhcpd.leases</userinput></screen>
446
447 <para>
448 If you want to start the DHCP Server at boot, install the
449 <phrase revision="sysv"><filename>/etc/rc.d/init.d/dhcpd</filename>
450 init script</phrase>
451 <phrase revision="systemd"><filename>dhcpd.service</filename>
452 unit</phrase> included in the
453 <xref linkend="bootscripts" revision="sysv"/>
454 <xref linkend="systemd-units" revision="systemd"/>
455 package:
456 </para>
457
458<screen role="root"><userinput>make install-dhcpd</userinput></screen>
459
460 <indexterm zone="dhcp dhcpd-config">
461 <primary sortas="f-dhcpd">dhcpd</primary>
462 </indexterm>
463
464 <para>
465 You will need to edit the
466 <phrase revision="sysv"><filename>/etc/sysconfig/dhcpd</filename></phrase>
467 <phrase revision="systemd"><filename>/etc/default/dhcpd</filename></phrase>
468 in order to set the interface on which <command>dhcpd</command>
469 will serve the DHCP requests.
470 </para>
471
472 </sect3>
473
474 </sect2>
475
476 <sect2 role="content">
477 <title>Contents</title>
478
479 <segmentedlist>
480 <segtitle>Installed Programs</segtitle>
481 <segtitle>Installed Libraries</segtitle>
482 <segtitle>Installed Directories</segtitle>
483
484 <seglistitem>
485 <seg>
486 dhclient, dhclient-script, dhcpd, dhcrelay and omshell
487 </seg>
488 <seg>
489 libdhcpctl.a and libomapi.a
490 </seg>
491 <seg>
492 /etc/dhcp,
493 /usr/include/dhcpctl,
494 /usr/include/isc-dhcp,
495 /usr/include/omapip,
496 /var/lib/dhclient and
497 /var/lib/dhcpd
498 </seg>
499 </seglistitem>
500 </segmentedlist>
501
502 <variablelist>
503 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
504 <?dbfo list-presentation="list"?>
505 <?dbhtml list-presentation="table"?>
506
507 <varlistentry id="dhclient">
508 <term><command>dhclient</command></term>
509 <listitem>
510 <para>
511 is the implementation of the DHCP client
512 </para>
513 <indexterm zone="dhcp dhclient">
514 <primary sortas="b-dhclient">dhclient</primary>
515 </indexterm>
516 </listitem>
517 </varlistentry>
518
519 <varlistentry id="dhclient-script">
520 <term><command>dhclient-script</command></term>
521 <listitem>
522 <para>
523 is used by dhclient to (re)configure interfaces. It can make
524 extra changes by invoking custom dhclient-{entry,exit}-hooks
525 </para>
526 <indexterm zone="dhcp dhclient-script">
527 <primary sortas="b-dhclient-script">dhclient-script</primary>
528 </indexterm>
529 </listitem>
530 </varlistentry>
531
532 <varlistentry id="dhcpd">
533 <term><command>dhcpd</command></term>
534 <listitem>
535 <para>
536 implements Dynamic Host Configuration Protocol (DHCP) and
537 Internet Bootstrap Protocol (BOOTP) requests for network
538 addresses
539 </para>
540 <indexterm zone="dhcp dhcpd">
541 <primary sortas="b-dhcpd">dhcpd</primary>
542 </indexterm>
543 </listitem>
544 </varlistentry>
545
546 <varlistentry id="dhcrelay">
547 <term><command>dhcrelay</command></term>
548 <listitem>
549 <para>
550 provides a means to accept DHCP and BOOTP requests on a subnet
551 without a DHCP server and relay them to a DHCP server on another
552 subnet
553 </para>
554 <indexterm zone="dhcp dhcrelay">
555 <primary sortas="b-dhcrelay">dhcrelay</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559
560 <varlistentry id="omshell">
561 <term><command>omshell</command></term>
562 <listitem>
563 <para>
564 provides an interactive way to connect to, query and
565 possibly change the ISC DHCP Server's state via OMAPI, the
566 Object Management API
567 </para>
568 <indexterm zone="dhcp omshell">
569 <primary sortas="b-omshell">omshell</primary>
570 </indexterm>
571 </listitem>
572 </varlistentry>
573
574 </variablelist>
575
576 </sect2>
577
578</sect1>
Note: See TracBrowser for help on using the repository browser.