source: networking/connect/dhcp-systemd.xml@ 84c9142

systemd-11177
Last change on this file since 84c9142 was fa36572, checked in by Krejzi <krejzi@…>, 10 years ago

More checks and fixes.

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

  • Property mode set to 100644
File size: 14.9 KB
RevLine 
[0931098]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[0931098]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
[697cb83f]6
[ac02266]7 <!ENTITY dhcp-download-http " ">
[697cb83f]8 <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
[06eea232]9 <!ENTITY dhcp-md5sum "b3a42ece3c7f2cd2e74a3e12ca881d20">
[03f254d]10 <!ENTITY dhcp-size "8.6 MB">
[06eea232]11 <!ENTITY dhcp-buildsize "109 MB">
12 <!ENTITY dhcp-time "0.4 SBU">
[0931098]13]>
14
[40330fcd]15<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
[6ad98e12]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">
[697cb83f]26 <primary sortas="a-DHCP">DHCP</primary>
[6ad98e12]27 </indexterm>
28
29 <sect2 role="package">
[697cb83f]30 <title>Introduction to ISC DHCP</title>
[6ad98e12]31
[697cb83f]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>
[6ad98e12]39
[fa36572]40 &lfs76_checked;
[fa3e12e1]41
[f37810e]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
[6ad98e12]50 <bridgehead renderas="sect3">Package Information</bridgehead>
51 <itemizedlist spacing="compact">
52 <listitem>
[697cb83f]53 <para>
54 Download (HTTP): <ulink url="&dhcp-download-http;"/>
55 </para>
[6ad98e12]56 </listitem>
57 <listitem>
[697cb83f]58 <para>
59 Download (FTP): <ulink url="&dhcp-download-ftp;"/>
60 </para>
[6ad98e12]61 </listitem>
62 <listitem>
[697cb83f]63 <para>
64 Download MD5 sum: &dhcp-md5sum;
65 </para>
[6ad98e12]66 </listitem>
67 <listitem>
[697cb83f]68 <para>
69 Download size: &dhcp-size;
70 </para>
[6ad98e12]71 </listitem>
72 <listitem>
[697cb83f]73 <para>
74 Estimated disk space required: &dhcp-buildsize;
75 </para>
[6ad98e12]76 </listitem>
77 <listitem>
[697cb83f]78 <para>
79 Estimated build time: &dhcp-time;
80 </para>
[6ad98e12]81 </listitem>
82 </itemizedlist>
83
[413bf97]84 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
[697cb83f]85 <itemizedlist spacing="compact">
[b89d0335]86 <listitem>
[697cb83f]87 <para>
[54f740f]88 Required patch:
[06eea232]89 <ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
[697cb83f]90 </para>
[b89d0335]91 </listitem>
[413bf97]92 <listitem>
[697cb83f]93 <para>
[54f740f]94 Optional patch:
[697cb83f]95 <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
96 </para>
[413bf97]97 </listitem>
98 </itemizedlist>
99
[3cb0c57]100 <para condition="html" role="usernotes">User Notes:
[697cb83f]101 <ulink url="&blfs-wiki;/dhcp"/>
102 </para>
[6ad98e12]103 </sect2>
104
[697cb83f]105 <sect2 role="kernel" id="dhcp-kernel">
[6ad98e12]106 <title>Kernel Configuration</title>
107
[697cb83f]108 <para>
109 You must have Packet Socket support (Networking Support &rArr;
110 Networking Options &rArr; Packet Socket) compiled into the kernel.
111 If you do not have IPv6 support (Networking Support &rArr;
112 Networking Options &rArr; The IPv6 Protocol) compiled in, then you
113 must use the missing_ipv6 patch.
114 </para>
[6ad98e12]115
116 <indexterm zone="dhcp dhcp-kernel">
[697cb83f]117 <primary sortas="d-DHCP">DHCP</primary>
[6ad98e12]118 </indexterm>
119
120 </sect2>
121
122 <sect2 role="installation">
[697cb83f]123 <title>Installation of ISC DHCP</title>
[6ad98e12]124
[697cb83f]125 <para>
126 If you have not compiled IPv6 support into the kernel, apply the
127 missing_ipv6 patch:
128 </para>
[b89d0335]129
[fa3e12e1]130<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
[b89d0335]131
[b33c421]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>
[76b71ab]139
[b33c421]140 <para>
141 Install <application>ISC DHCP</application> by running
142 the following commands:
143 </para>
[6ad98e12]144
[06eea232]145<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-client_script-1.patch &amp;&amp;
[697cb83f]146CFLAGS="-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 &amp;&amp;
156make</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 &amp;&amp;
169mv -v /usr/sbin/dhclient /sbin &amp;&amp;
170install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
[fa3e12e1]171
[697cb83f]172 <para>
173 Skip to <xref linkend="dhclient-config"/> in order to configure the client
174 </para>
[6ad98e12]175
[697cb83f]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>
[fa3e12e1]181
[697cb83f]182<screen role="root"><userinput>make -C server install</userinput></screen>
[fa3e12e1]183
[697cb83f]184 <para>
185 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
186 </para>
[275b1da]187
[697cb83f]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>
[04a6794]194
[697cb83f]195<screen role="root"><userinput>make install &amp;&amp;
196mv -v /usr/sbin/dhclient /sbin &amp;&amp;
[ac02266]197install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
[fa3e12e1]198
[697cb83f]199 </sect2>
[fa3e12e1]200
[697cb83f]201 <sect2 role="configuration">
202 <title>Configuring ISC DHCP</title>
[fa3e12e1]203
[697cb83f]204 <sect3 id="dhcp-config">
205 <title>Config Files</title>
[fa3e12e1]206
[697cb83f]207 <para>
208 <filename>/etc/dhcp/dhclient.conf</filename> and
209 <filename>/etc/dhcp/dhcpd.conf</filename>
210 </para>
[0931098]211
[697cb83f]212 <indexterm zone="dhcp dhcp-config">
213 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
214 </indexterm>
[0931098]215
[697cb83f]216 <indexterm zone="dhcp dhcp-config">
217 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
218 </indexterm>
[0931098]219
[697cb83f]220 </sect3>
[fa3e12e1]221
[697cb83f]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 &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
232<literal># Begin /etc/dhcp/dhclient.conf
233#
234# Basic dhclient.conf(5)
235
236#prepend domain-name-servers 127.0.0.1;
237request 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;
241require 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>
249EOF</userinput></screen>
[fa3e12e1]250
[697cb83f]251 <para>
252 See <command>man 5 dhclient.conf</command> for additional options.
253 </para>
[fa3e12e1]254
[697cb83f]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>
[fa3e12e1]260
[697cb83f]261<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
[fa3e12e1]262
[a7bd7349]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
[697cb83f]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>
[0931098]282
[a7bd7349]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>
[0931098]297
[697cb83f]298 </sect3>
[0931098]299
[697cb83f]300 <sect3 id="dhcpd-config">
301 <title>Server Configuration</title>
[4774914f]302
[697cb83f]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>
[04a6794]308
[697cb83f]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>
[0931098]314
[697cb83f]315<screen role="root"><userinput>cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; "EOF"
316<literal># Begin /etc/dhcp/dhcpd.conf
317#
318# Example dhcpd.conf(5)
[0931098]319
[697cb83f]320# Use this to enble / disable dynamic dns updates globally.
321ddns-update-style none;
[0931098]322
[697cb83f]323# option definitions common to all supported networks...
324option domain-name "example.org";
325option domain-name-servers ns1.example.org, ns2.example.org;
[0931098]326
[697cb83f]327default-lease-time 600;
328max-lease-time 7200;
[6ad98e12]329
[697cb83f]330# This is a very basic subnet declaration.
331subnet 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}
[0931098]335
[697cb83f]336# End /etc/dhcp/dhcpd.conf</literal>
[6ad98e12]337EOF</userinput></screen>
338
[697cb83f]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
[d49cae5]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:
[697cb83f]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
[d49cae5]367 <filename>/etc/default/dhcpd</filename> file in order
[697cb83f]368 to set the interface on which <command>dhcpd</command>
369 will serve the DHCP requests.
370 </para>
[6ad98e12]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>
[697cb83f]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>
[03f254d]392 /etc/dhcp,
[697cb83f]393 /usr/include/dhcpctl,
394 /usr/include/isc-dhcp,
395 /usr/include/omapip,
396 /var/lib/dhclient and
397 /var/lib/dhcpd
398 </seg>
[6ad98e12]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>
[697cb83f]410 <para>
411 is the implementation of the DHCP client.
412 </para>
[6ad98e12]413 <indexterm zone="dhcp dhclient">
414 <primary sortas="b-dhclient">dhclient</primary>
415 </indexterm>
416 </listitem>
417 </varlistentry>
418
[fa3e12e1]419 <varlistentry id="dhclient-script">
420 <term><command>dhclient-script</command></term>
421 <listitem>
[697cb83f]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>
[fa3e12e1]426 <indexterm zone="dhcp dhclient-script">
427 <primary sortas="b-dhclient-script">dhclient-script</primary>
428 </indexterm>
429 </listitem>
430 </varlistentry>
431
[6ad98e12]432 <varlistentry id="dhcpd">
433 <term><command>dhcpd</command></term>
434 <listitem>
[697cb83f]435 <para>
436 implements Dynamic Host Configuration Protocol (DHCP) and
437 Internet Bootstrap Protocol (BOOTP) requests for network
438 addresses.
439 </para>
[6ad98e12]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>
[697cb83f]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>
[6ad98e12]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>
[697cb83f]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>
[6ad98e12]468 <indexterm zone="dhcp omshell">
469 <primary sortas="b-omshell">omshell</primary>
470 </indexterm>
471 </listitem>
472 </varlistentry>
473
474 </variablelist>
475
476 </sect2>
[04a6794]477
[f45b1953]478</sect1>
Note: See TracBrowser for help on using the repository browser.