source: networking/connect/dhcp.xml@ 0885b771

10.0 10.1 7.10 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind nosym perl-modules qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 0885b771 was 0885b771, checked in by Pierre Labastie <pieere@…>, 5 years ago

Tag DHCP

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

  • Property mode set to 100644
File size: 15.7 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 "60f330a69566c52d841ddaab9d7a2662">
10 <!ENTITY dhcp-size "8.8 MB">
11 <!ENTITY dhcp-buildsize "212 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 </para>
171
172 <para>
173 If you only want to install the <application>ISC DHCP</application> client,
174 issue the following commands as the
175 <systemitem class="username">root</systemitem> user:
176 </para>
177
178<screen role="root"><userinput>make -C client install &amp;&amp;
179mv -v /usr/sbin/dhclient /sbin &amp;&amp;
180install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
181
182 <para>
183 Skip to <xref linkend="dhclient-config"/> in order to configure the client
184 </para>
185
186 <para>
187 If you only want to install the <application>ISC DHCP</application> server,
188 issue the following command as the
189 <systemitem class="username">root</systemitem> user:
190 </para>
191
192<screen role="root"><userinput>make -C server install</userinput></screen>
193
194 <para>
195 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
196 </para>
197
198 <para>
199 Alternatively, you can install whole package which includes the client,
200 server, relay, static libraries and development headers by running the
201 following commands as the
202 <systemitem class="username">root</systemitem> user:
203 </para>
204
205<screen role="root"><userinput>make install &amp;&amp;
206mv -v /usr/sbin/dhclient /sbin &amp;&amp;
207install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
208
209 </sect2>
210
211 <sect2 role="configuration">
212 <title>Configuring ISC DHCP</title>
213
214 <sect3 id="dhcp-config">
215 <title>Config Files</title>
216
217 <para>
218 <filename>/etc/dhcp/dhclient.conf</filename> and
219 <filename>/etc/dhcp/dhcpd.conf</filename>
220 </para>
221
222 <indexterm zone="dhcp dhcp-config">
223 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
224 </indexterm>
225
226 <indexterm zone="dhcp dhcp-config">
227 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
228 </indexterm>
229
230 </sect3>
231
232 <sect3 id="dhclient-config">
233 <title>Client Configuration</title>
234
235 <para>
236 Create basic <filename>/etc/dhcp/dhclient.conf</filename>
237 by running the following command as the
238 <systemitem class="username">root</systemitem> user:
239 </para>
240
241<screen role="root"><userinput>cat &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
242<literal># Begin /etc/dhcp/dhclient.conf
243#
244# Basic dhclient.conf(5)
245
246#prepend domain-name-servers 127.0.0.1;
247request subnet-mask, broadcast-address, time-offset, routers,
248 domain-name, domain-name-servers, domain-search, host-name,
249 netbios-name-servers, netbios-scope, interface-mtu,
250 ntp-servers;
251require subnet-mask, domain-name-servers;
252#timeout 60;
253#retry 60;
254#reboot 10;
255#select-timeout 5;
256#initial-interval 2;
257
258# End /etc/dhcp/dhclient.conf</literal>
259EOF</userinput></screen>
260
261 <para>
262 See <command>man 5 dhclient.conf</command> for additional options.
263 </para>
264
265 <para>
266 Now create the <filename class="directory">/var/lib/dhclient</filename>
267 directory which will contain DHCP Client leases by running the following
268 command as the <systemitem class="username">root</systemitem> user:
269 </para>
270
271<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
272
273 <para>
274 At this point you can test if <command>dhclient</command> is
275 behaving as expected by running the following command as the
276 <systemitem class="username">root</systemitem> user:
277 </para>
278
279<screen role="root"><userinput>dhclient <replaceable>&lt;eth0&gt;</replaceable></userinput></screen>
280
281 <para>
282 Replace <replaceable>&lt;eth0&gt;</replaceable> with your
283 desired interface. If you want more verbose output, add the
284 <command>-v</command> parameter to the command above.
285 </para>
286
287 <para id="dhclient-service">
288 If you want to configure network interfaces at boot using
289 <command>dhclient</command>, you need to install the
290 <filename>/lib/services/dhclient</filename> script
291 included in <xref linkend="bootscripts"/> package:
292 </para>
293
294<screen role="root"><userinput>make install-service-dhclient</userinput></screen>
295
296 <indexterm zone="dhcp dhclient-service">
297 <primary sortas="f-dhclient">dhclient (service script)</primary>
298 </indexterm>
299
300 <para id="dhclient-ifconfig">
301 Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
302 configuration file with the following commands as the
303 <systemitem class="username">root</systemitem> user:
304 </para>
305
306<screen role="root"><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
307<literal>ONBOOT="yes"
308IFACE="eth0"
309SERVICE="dhclient"
310DHCP_START=""
311DHCP_STOP=""
312
313# Set PRINTIP="yes" to have the script print
314# the DHCP assigned IP address
315PRINTIP="no"
316
317# Set PRINTALL="yes" to print the DHCP assigned values for
318# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
319PRINTALL="no"</literal>
320EOF</userinput></screen>
321
322 <indexterm zone="dhcp dhclient-ifconfig">
323 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
324 </indexterm>
325
326 <para>
327 Adjust the file to suit your needs.
328 </para>
329
330 <para>
331 For more information on the appropriate <envar>DHCP_START</envar>
332 and <envar>DHCP_STOP</envar> values see
333 <command>man 8 dhclient</command>.
334 </para>
335
336 </sect3>
337
338 <sect3 id="dhcpd-config">
339 <title>Server Configuration</title>
340
341 <para>
342 Note that you only need the DHCP server if you want to issue
343 LAN addresses over your network. The DHCP client doesn't need
344 the server in order to function properly.
345 </para>
346
347 <para>
348 Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
349 by running the following command as the
350 <systemitem class="username">root</systemitem> user:
351 </para>
352
353<screen role="root"><userinput>cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; "EOF"
354<literal># Begin /etc/dhcp/dhcpd.conf
355#
356# Example dhcpd.conf(5)
357
358# Use this to enble / disable dynamic dns updates globally.
359ddns-update-style none;
360
361# option definitions common to all supported networks...
362option domain-name "example.org";
363option domain-name-servers ns1.example.org, ns2.example.org;
364
365default-lease-time 600;
366max-lease-time 7200;
367
368# This is a very basic subnet declaration.
369subnet 10.254.239.0 netmask 255.255.255.224 {
370 range 10.254.239.10 10.254.239.20;
371 option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
372}
373
374# End /etc/dhcp/dhcpd.conf</literal>
375EOF</userinput></screen>
376
377 <para>
378 Adjust the file to suit your needs. See
379 <command>man 5 dhcpd.conf</command> for additional options.
380 </para>
381
382 <para>
383 Now create the <filename class="directory">/var/lib/dhcpd</filename>
384 directory which will contain DHCP Server leases by running the following
385 command as the <systemitem class="username">root</systemitem> user:
386 </para>
387
388<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</userinput></screen>
389
390 <para>
391 If you want to start the DHCP Server at boot, install
392 the <filename>/etc/rc.d/init.d/dhcpd</filename>
393 init script included in the <xref linkend="bootscripts"/>
394 package:
395 </para>
396
397<screen role="root"><userinput>make install-dhcpd</userinput></screen>
398
399 <indexterm zone="dhcp dhcpd-config">
400 <primary sortas="f-dhcpd">dhcpd</primary>
401 </indexterm>
402
403 <para>
404 You will need to edit the
405 <filename>/etc/sysconfig/dhcpd</filename> in order
406 to set the interface on which <command>dhcpd</command>
407 will serve the DHCP requests.
408 </para>
409
410 </sect3>
411
412 </sect2>
413
414 <sect2 role="content">
415 <title>Contents</title>
416
417 <segmentedlist>
418 <segtitle>Installed Programs</segtitle>
419 <segtitle>Installed Libraries</segtitle>
420 <segtitle>Installed Directories</segtitle>
421
422 <seglistitem>
423 <seg>
424 dhclient, dhclient-script, dhcpd, dhcrelay and omshell
425 </seg>
426 <seg>
427 libdhcpctl.a, libdst.a and libomapi.a
428 </seg>
429 <seg>
430 /etc/dhcp,
431 /usr/include/dhcpctl,
432 /usr/include/isc-dhcp,
433 /usr/include/omapip,
434 /var/lib/dhclient and
435 /var/lib/dhcpd
436 </seg>
437 </seglistitem>
438 </segmentedlist>
439
440 <variablelist>
441 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
442 <?dbfo list-presentation="list"?>
443 <?dbhtml list-presentation="table"?>
444
445 <varlistentry id="dhclient">
446 <term><command>dhclient</command></term>
447 <listitem>
448 <para>
449 is the implementation of the DHCP client.
450 </para>
451 <indexterm zone="dhcp dhclient">
452 <primary sortas="b-dhclient">dhclient</primary>
453 </indexterm>
454 </listitem>
455 </varlistentry>
456
457 <varlistentry id="dhclient-script">
458 <term><command>dhclient-script</command></term>
459 <listitem>
460 <para>
461 is used by dhclient to (re)configure interfaces. It can make
462 extra changes by invoking custom dhclient-{entry,exit}-hooks.
463 </para>
464 <indexterm zone="dhcp dhclient-script">
465 <primary sortas="b-dhclient-script">dhclient-script</primary>
466 </indexterm>
467 </listitem>
468 </varlistentry>
469
470 <varlistentry id="dhcpd">
471 <term><command>dhcpd</command></term>
472 <listitem>
473 <para>
474 implements Dynamic Host Configuration Protocol (DHCP) and
475 Internet Bootstrap Protocol (BOOTP) requests for network
476 addresses.
477 </para>
478 <indexterm zone="dhcp dhcpd">
479 <primary sortas="b-dhcpd">dhcpd</primary>
480 </indexterm>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry id="dhcrelay">
485 <term><command>dhcrelay</command></term>
486 <listitem>
487 <para>
488 provides a means to accept DHCP and BOOTP requests on a subnet
489 without a DHCP server and relay them to a DHCP server on another
490 subnet.
491 </para>
492 <indexterm zone="dhcp dhcrelay">
493 <primary sortas="b-dhcrelay">dhcrelay</primary>
494 </indexterm>
495 </listitem>
496 </varlistentry>
497
498 <varlistentry id="omshell">
499 <term><command>omshell</command></term>
500 <listitem>
501 <para>
502 provides an interactive way to connect to, query and
503 possibly change the ISC DHCP Server's state via OMAPI, the
504 Object Management API.
505 </para>
506 <indexterm zone="dhcp omshell">
507 <primary sortas="b-omshell">omshell</primary>
508 </indexterm>
509 </listitem>
510 </varlistentry>
511
512 </variablelist>
513
514 </sect2>
515
516</sect1>
Note: See TracBrowser for help on using the repository browser.