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

7.6-blfs 7.6-systemd kde5-14269 kde5-14686 systemd-13485
Last change on this file since ee4502d4 was ee4502d4, checked in by Krejzi <krejzi@…>, 10 years ago

Add dhclient systemd unit to isc dhcp page.

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

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