source: networking/connect/dhcp-systemd.xml@ ac38e9dc

systemd-13485
Last change on this file since ac38e9dc was ac38e9dc, checked in by Douglas R. Reno <renodr@…>, 9 years ago

Import back into SVN from Github

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