source: archive/dhcp.xml

trunk
Last change on this file was 194d47b, checked in by Douglas R. Reno <renodr@…>, 10 months ago

Archive ISC DHCP (and dhclient).

It's been succeeded by Kea for the server, and dhcpcd for the client.

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