source: networking/connect/dhcp.xml@ 3c7bd00

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 8.0 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 nosym 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 3c7bd00 was 3c7bd00, checked in by DJ Lucas <dj@…>, 8 years ago

Temporary render fix for bootscripts with REV=systemd.

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

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