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