source: networking/connect/dhcp.xml@ e3fec8f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since e3fec8f was 697cb83f, checked in by Krejzi <krejzi@…>, 12 years ago

ISC DHCP 4.2.4-P1 with bootscript and network service updates. Merged dhcp client configuration into dhcp page.

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

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