source: networking/connect/dhcp.xml@ 6d11bc30

systemd-13485
Last change on this file since 6d11bc30 was 37191af, checked in by Douglas R. Reno <renodr@…>, 8 years ago

Sync to trunk r17270. Last round for the night.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@17330 af4574ff-66df-0310-9fd7-8a98e5e911e0

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