source: networking/connect/dhcp.xml@ 048aa04

11.2 11.3 12.0 12.1 12.2 gimp3 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/for-12.3 xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/xf86-video-removal
Last change on this file since 048aa04 was 1d083343, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

dhcp: mark test instruction as remap="test"

  • Property mode set to 100644
File size: 18.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 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 "3089a1ebd20a802ec0870ae337d43907">
10 <!ENTITY dhcp-size "9.4 MB">
11 <!ENTITY dhcp-buildsize "115 MB">
12 <!ENTITY dhcp-time "0.4 SBU">
13]>
14
15<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
16 <?dbhtml filename="dhcp.html"?>
17
18 <sect1info>
19 <date>$Date$</date>
20 </sect1info>
21
22 <title>DHCP-&dhcp-version;</title>
23
24 <indexterm zone="dhcp">
25 <primary sortas="a-DHCP">DHCP</primary>
26 </indexterm>
27
28 <sect2 role="package">
29 <title>Introduction to ISC DHCP</title>
30
31 <para>
32 The <application>ISC DHCP</application> package contains both the client
33 and server programs for DHCP. <command>dhclient</command> (the client) is
34 used for connecting to a network which uses DHCP to assign network
35 addresses. <command>dhcpd</command> (the server) is used for assigning
36 network addresses on private networks.
37 </para>
38
39 &lfs111_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&dhcp-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&dhcp-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &dhcp-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &dhcp-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &dhcp-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &dhcp-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74<!--
75 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
76 <itemizedlist spacing="compact">
77 <listitem>
78 <para>
79 Required patch:
80 <ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
81 </para>
82 </listitem>
83 <listitem>
84 <para>
85 Optional patch:
86 <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
87 </para>
88 </listitem>
89 </itemizedlist>
90-->
91 <para condition="html" role="usernotes">User Notes:
92 <ulink url="&blfs-wiki;/dhcp"/>
93 </para>
94 </sect2>
95
96 <sect2 role="kernel" id="dhcp-kernel">
97 <title>Kernel Configuration</title>
98
99 <para>
100 You must have Packet Socket support. IPv6 support is optional.
101 </para>
102
103<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
104 Networking options ---&gt;
105 &lt;*&gt; Packet socket [CONFIG_PACKET]
106 &lt;*&gt; The IPv6 Protocol ---&gt; [CONFIG_IPV6]</literal></screen>
107<!--
108 <para>
109 If you do not have IPv6 support:
110 </para>
111
112<screen><literal>[*] Networking support - - -&gt; [CONFIG_NET]
113 Networking Options - - -&gt;
114 &lt;*&gt; The IPv6 Protocol - - -&gt; [CONFIG_IPV6]</literal></screen>
115
116 <para>
117 compiled in, then you must use the <quote>missing_ipv6</quote> patch.
118 </para>
119-->
120 <indexterm zone="dhcp dhcp-kernel">
121 <primary sortas="d-DHCP">DHCP</primary>
122 </indexterm>
123
124 </sect2>
125
126 <sect2 role="installation">
127 <title>Installation of ISC DHCP</title>
128
129 <para>
130 First, fix a build issue with GCC 10 and later:
131 </para>
132
133<screen><userinput>sed -i '/o.*dhcp_type/d' server/mdb.c &amp;&amp;
134sed -r '/u.*(local|remote)_port/d' \
135 -i client/dhclient.c \
136 relay/dhcrelay.c</userinput></screen>
137
138 <note>
139 <para>
140 This package does not support parallel build.
141 </para>
142 </note>
143<!-- This should not be needed any more. Visual check appears to handle it.
144 <para>
145 If you have not compiled IPv6 support into the kernel, apply the
146 missing_ipv6 patch:
147 </para>
148
149<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
150-->
151 <note>
152 <para>
153 Be careful with the instructions below. The single and
154 double quotes are important because the defined
155 variables are used verbatim in the code.
156 </para>
157 </note>
158
159 <para>
160 Install <application>ISC DHCP</application> by running
161 the following commands:
162 </para>
163
164<!--
165 Running ( export CFLAGS=... ./configure ... ) in a subshell
166 preserves CFLAGS if they are set in environment
167-->
168<screen><userinput>( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \
169 -D_PATH_DHCLIENT_SCRIPT='\"/usr/sbin/dhclient-script\"' \
170 -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
171 -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &amp;&amp;
172
173./configure --prefix=/usr \
174 --sysconfdir=/etc/dhcp \
175 --localstatedir=/var \
176 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
177 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
178 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
179 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
180) &amp;&amp;
181make -j1</userinput></screen>
182
183 <para>
184 <!-- Note: make check builds a library, but otherwise does nothing. -->
185 This package does not come with a test suite.
186 </para>
187
188 <para>
189 If you only want to install the <application>ISC DHCP</application> client,
190 issue the following commands as the
191 <systemitem class="username">root</systemitem> user:
192 </para>
193
194<screen role="root"><userinput>make -C client install &amp;&amp;
195install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
196
197 <para>
198 Skip to <xref linkend="dhclient-config"/> in order to configure the
199 client
200 </para>
201
202 <para>
203 If you only want to install the <application>ISC DHCP</application> server,
204 issue the following command as the
205 <systemitem class="username">root</systemitem> user:
206 </para>
207
208<screen role="root"><userinput>make -C server install</userinput></screen>
209
210 <para>
211 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
212 </para>
213
214 <para>
215 Alternatively, you can install whole package which includes the client,
216 server, relay, static libraries and development headers by running the
217 following commands as the
218 <systemitem class="username">root</systemitem> user:
219 </para>
220
221<screen role="root"><userinput>make install &amp;&amp;
222install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
223
224 </sect2>
225
226 <sect2 role="configuration">
227 <title>Configuring ISC DHCP</title>
228
229 <sect3 id="dhcp-config">
230 <title>Config Files</title>
231
232 <para>
233 <filename>/etc/dhcp/dhclient.conf</filename> and
234 <filename>/etc/dhcp/dhcpd.conf</filename>
235 </para>
236
237 <indexterm zone="dhcp dhcp-config">
238 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
239 </indexterm>
240
241 <indexterm zone="dhcp dhcp-config">
242 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
243 </indexterm>
244
245 </sect3>
246
247 <sect3 id="dhclient-config">
248 <title>Client Configuration</title>
249
250 <para>
251 Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
252 by running the following command as the
253 <systemitem class="username">root</systemitem> user:
254 </para>
255
256<screen role="root"><userinput>install -vdm755 /etc/dhcp &amp;&amp;
257cat &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
258<literal># Begin /etc/dhcp/dhclient.conf
259#
260# Basic dhclient.conf(5)
261
262#prepend domain-name-servers 127.0.0.1;
263request subnet-mask, broadcast-address, time-offset, routers,
264 domain-name, domain-name-servers, domain-search, host-name,
265 netbios-name-servers, netbios-scope, interface-mtu,
266 ntp-servers;
267require subnet-mask, domain-name-servers;
268#timeout 60;
269#retry 60;
270#reboot 10;
271#select-timeout 5;
272#initial-interval 2;
273
274# End /etc/dhcp/dhclient.conf</literal>
275EOF</userinput></screen>
276
277 <para>
278 See <command>man 5 dhclient.conf</command> for additional options.
279 </para>
280
281 <para>
282 Now create the <filename class="directory">/var/lib/dhclient</filename>
283 directory which will contain DHCP Client leases by running the following
284 command as the <systemitem class="username">root</systemitem> user:
285 </para>
286
287<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
288
289 <para id="dhclient-service-sysd" revision="systemd">
290 If you want to configure network interfaces at boot using
291 <command>dhclient</command>, you need to install the
292 <filename>dhclient@.service</filename> unit included in the
293 <xref linkend="systemd-units"/> package by running the following
294 command as the <systemitem class="username">root</systemitem> user:
295 </para>
296
297 <indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
298 <primary sortas="f-dhclient">dhclient@.service</primary>
299 </indexterm>
300
301<screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
302
303 <note revision="systemd">
304 <para>
305 Make sure that you disable the <command>systemd-networkd</command>
306 service or configure it not to manage the interfaces you want to
307 manage with <command>dhclient</command>.
308 </para>
309 </note>
310
311 <para>
312 At this point you can test if <command>dhclient</command> is
313 behaving as expected by running the following command as the
314 <systemitem class="username">root</systemitem> user:
315 </para>
316
317<screen role="root"
318 remap="test"
319 revision="sysv"><userinput>dhclient <replaceable>&lt;eth0&gt;</replaceable></userinput></screen>
320
321<screen role="root"
322 remap="test"
323 revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
324
325 <para revision="sysv">
326 Replace <replaceable>&lt;eth0&gt;</replaceable> with your
327 desired interface. If you want more verbose output, add the
328 <command>-v</command> parameter to the command above.
329 </para>
330
331 <para id="dhclient-service" revision="sysv">
332 If you want to configure network interfaces at boot using
333 <command>dhclient</command>, you need to install the
334 <filename>/lib/services/dhclient</filename> script
335 included in <xref linkend="bootscripts"/> package:
336 </para>
337
338<screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
339
340 <indexterm zone="dhcp dhclient-service" revision="sysv">
341 <primary sortas="f-dhclient">dhclient (service script)</primary>
342 </indexterm>
343
344 <para id="dhclient-ifconfig" revision="sysv">
345 Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
346 configuration file with the following commands as the
347 <systemitem class="username">root</systemitem> user:
348 </para>
349
350<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
351<literal>ONBOOT="yes"
352IFACE="eth0"
353SERVICE="dhclient"
354DHCP_START=""
355DHCP_STOP=""
356
357# Set PRINTIP="yes" to have the script print
358# the DHCP assigned IP address
359PRINTIP="no"
360
361# Set PRINTALL="yes" to print the DHCP assigned values for
362# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
363PRINTALL="no"</literal>
364EOF</userinput></screen>
365
366 <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
367 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
368 </indexterm>
369
370 <para revision="sysv">
371 Adjust the file to suit your needs.
372 </para>
373
374 <para revision="sysv">
375 For more information on the appropriate <envar>DHCP_START</envar>
376 and <envar>DHCP_STOP</envar> values see
377 <command>man 8 dhclient</command>.
378 </para>
379
380 <para revision="systemd">
381 To start <command>dhclient</command> on a specific interface
382 at boot, enable the previously installed systemd unit by
383 running the following command as the
384 <systemitem class="username">root</systemitem> user:
385 </para>
386
387<screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
388
389 <para revision="systemd">
390 Replace <replaceable>eth0</replaceable> with the actual interface name.
391 </para>
392
393 </sect3>
394
395 <sect3 id="dhcpd-config">
396 <title>Server Configuration</title>
397
398 <para>
399 Note that you only need the DHCP server if you want to issue
400 LAN addresses over your network. The DHCP client doesn't need
401 the server in order to function properly.
402 </para>
403
404 <para>
405 Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
406 by running the following command as the
407 <systemitem class="username">root</systemitem> user:
408 </para>
409
410<screen role="root"><userinput>cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; "EOF"
411<literal># Begin /etc/dhcp/dhcpd.conf
412#
413# Example dhcpd.conf(5)
414
415# Use this to enable / disable dynamic dns updates globally.
416ddns-update-style none;
417
418# option definitions common to all supported networks...
419option domain-name "example.org";
420option domain-name-servers ns1.example.org, ns2.example.org;
421
422default-lease-time 600;
423max-lease-time 7200;
424
425# This is a very basic subnet declaration.
426subnet 10.254.239.0 netmask 255.255.255.224 {
427 range 10.254.239.10 10.254.239.20;
428 option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
429}
430
431# End /etc/dhcp/dhcpd.conf</literal>
432EOF</userinput></screen>
433
434 <para>
435 Adjust the file to suit your needs. See
436 <command>man 5 dhcpd.conf</command> for additional options.
437 </para>
438
439 <para>
440 Now create the <filename class="directory">/var/lib/dhcpd</filename>
441 directory which will contain DHCP Server leases by running the following
442 command as the <systemitem class="username">root</systemitem> user:
443 </para>
444
445<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</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 inti 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.