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