source: networking/connect/dhcp.xml@ d60f0d5

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules 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 d60f0d5 was d60f0d5, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Update to sqlite-3.20.0.
Update to nmap-7.60.
Update to dhcp-4.3.6.
Update to poppler-0.57.0.
Update to ffmpeg-3.3.3.

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

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