source: networking/connect/dhcp.xml@ ecc6758

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ecc6758 was ac02266, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Update to dhcp-4.2.3-P2.
Install needed dhclient script in instructions.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@9355 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 13.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 <!-- isc have a weird way of offering the tarballs and without dots in version!
7 FIXME - change hardcoded 423s in http url and version in ftp when upgrading -->
8 <!ENTITY dhcp-download-http " ">
9 <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
10 <!ENTITY dhcp-md5sum "14f57fd580d01633d0fad4809007a801">
11 <!ENTITY dhcp-size "9.1 MB">
12 <!ENTITY dhcp-buildsize "192 MB (client and server), 140MB client only, 172MB server only">
13 <!ENTITY dhcp-time "0.7 SBU (client and server, or server), 0.6 SBU client only ">
14]>
15
16<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
17 <?dbhtml filename="dhcp.html"?>
18
19 <sect1info>
20 <othername>$LastChangedBy$</othername>
21 <date>$Date$</date>
22 </sect1info>
23
24 <title>DHCP-&dhcp-version;</title>
25
26 <indexterm zone="dhcp">
27 <primary sortas="a-dhcp">Dhcp</primary>
28 </indexterm>
29
30 <sect2 role="package">
31 <title>Introduction to DHCP</title>
32
33 <para>The <application>DHCP</application> package contains both the client
34 and server programs for DHCP. <command>dhclient</command> (the client) is
35 useful for connecting your computer to a network which uses DHCP to assign
36 network addresses. <command>dhcpd</command> (the server) is useful for
37 assigning network addresses on your private network.</para>
38
39 &lfs70_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>Download (HTTP): <ulink url="&dhcp-download-http;"/></para>
45 </listitem>
46 <listitem>
47 <para>Download (FTP): <ulink url="&dhcp-download-ftp;"/></para>
48 </listitem>
49 <listitem>
50 <para>Download MD5 sum: &dhcp-md5sum;</para>
51 </listitem>
52 <listitem>
53 <para>Download size: &dhcp-size;</para>
54 </listitem>
55 <listitem>
56 <para>Estimated disk space required: &dhcp-buildsize;</para>
57 </listitem>
58 <listitem>
59 <para>Estimated build time: &dhcp-time;</para>
60 </listitem>
61 </itemizedlist>
62
63 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
64 <itemizedlist spacing='compact'>
65 <listitem>
66 <para>Recommended Patch (for client):
67 <ulink url="&patch-root;/dhcp-&dhcp-version;-iproute2-1.patch"/></para>
68 </listitem>
69 <listitem>
70 <para>Optional Patch:
71 <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/></para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">DHCP Dependencies</bridgehead>
76
77 <bridgehead renderas="sect4">Required</bridgehead>
78 <para role="required"><xref linkend="net-tools"/> is required at runtime
79 by <command>dhclient</command> if you do not use the iproute2 patch.</para>
80
81 <para condition="html" role="usernotes">User Notes:
82 <ulink url="&blfs-wiki;/dhcp"/></para>
83
84 </sect2>
85
86 <sect2 role="kernel" id='dhcp-kernel'>
87 <title>Kernel Configuration</title>
88
89 <para>You must have Packet Socket support (Networking
90 Support &rArr; Networking Options &rArr; Packet Socket) compiled into
91 the kernel. If you do not have IPv6 support (Networking Support &rArr;
92 Networking Options &rArr; The IPv6 Protocol) compiled in, then you
93 must use the missing_ipv6 patch.</para>
94
95 <indexterm zone="dhcp dhcp-kernel">
96 <primary sortas="d-dhcp">DHCP</primary>
97 </indexterm>
98
99 </sect2>
100
101 <sect2 role="installation">
102 <title>Installation of DHCP</title>
103
104 <para>If you have not compiled IPv6 support into the kernel, apply the
105 missing_ipv6 patch</para>
106
107<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
108
109 <para>If you are installing the client, apply the iproute2 patch unless you
110 will have installed <application>net-tools</application> by the time you wish
111 to use the client:</para>
112
113<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-iproute2-1.patch</userinput></screen>
114
115 <para>Install <application>DHCP</application> by running
116 the following commands:</para>
117
118<screen><userinput>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in &amp;&amp;
119./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
120 --sbindir=/sbin \
121 --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
122 --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
123 --with-cli-lease-file=/var/state/dhclient.leases \
124 --with-cli6-lease-file=/var/state/dhclient6.leases &amp;&amp;
125sed -i 's/-Werror//' {client,common,dst,omapip,relay,server,tests}/Makefile</userinput></screen>
126
127 <para>If you only wish to build the server, enter:</para>
128<screen><userinput>sed -i 's/ client//' Makefile</userinput></screen>
129
130 <para>If you only wish to build the client, enter:</para>
131<screen><userinput>sed -i 's/ dhcpctl relay server//' Makefile</userinput></screen>
132
133 <para>Build your chosen variant(s) with:</para>
134<screen><userinput>make</userinput></screen>
135
136 <para>To test the results, issue: <command>make check</command></para>
137
138 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
139
140<screen role="root"><userinput>make install &amp;&amp;
141install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
142
143 <para>The supplied <filename>/etc/dhcpd.conf</filename> (server) and
144 <filename>/etc/dhclient.conf</filename> (client) are examples for a
145 specific <literal>BSD</literal> system. They are unlikely to be appropriate
146 to your needs, but you may wish to read them for ideas before deleting them
147 or moving them to a different location.</para>
148
149 <para>Now create any needed directories for the leases.</para>
150
151 <para>For the server:</para>
152
153<screen role="root"><userinput>mkdir -pv /var/state/dhcp</userinput></screen>
154
155 <para>For the client:</para>
156<screen role="root"><userinput>mkdir -pv /var/state</userinput></screen>
157
158 </sect2>
159
160 <sect2 role="commands">
161 <title>Command Explanations</title>
162
163 <para><command>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in</command>
164 This command moves the <command>dhcp</command> program to
165 <filename class='directory'>/usr/sbin</filename> instead of
166 <filename class='directory'>/sbin</filename> because it is not needed
167 while the server is booting.</para>
168
169 <para><command>--sbindir=/sbin</command> The <command>dhclient</command>
170 program is moved to <filename class='directory'>/sbin</filename> instead of
171 <filename class='directory'>/usr/sbin</filename> so that it is available
172 during boot, e.g. if <filename class='directory'>/usr</filename> is to be
173 an <literal>nfs</literal> mount.</para>
174
175 <para><command>--with-*-lease-files=...</command> By default, lease files
176 are placed in <filename class='directory'>/var/db</filename> which is an
177 anachronism.</para>
178
179 <para><command>sed -i 's/-Werror//' {client,common,...}/Makefile</command> -
180 the Makefiles in this package add <literal>-Werror</literal> to the
181 <literal>CFLAGS</literal>. On recent versions of <application>gcc</application>
182 more things, particularly unused variables, create warnings. The
183 <literal>-Werror</literal> flag causes warnings to break the build, so we
184 remove it where necessary.</para>
185
186 <para><command>sed -i 's/ something//' Makefile</command> - this stops the
187 build from entering the director(y,ies) named here.</para>
188
189 <para><option>rm -v /usr/lib/lib{dhcpctl,dst,omapi}.a</option> - there is
190 no easy way to prevent these static libraries being installed, but they are
191 only needed during the build of this package. <filename>libdhcpctl.a</filename>
192 is only installed if you build the server.</para>
193
194 </sect2>
195
196 <sect2 role="configuration">
197 <title>Configuring DHCP</title>
198
199 <sect3 id='dhcp-config'>
200 <title>Config Files</title>
201
202 <para><filename>/etc/dhclient.conf</filename> and
203 <filename>/etc/dhcpd.conf</filename></para>
204
205 <indexterm zone="dhcp dhcp-config">
206 <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
207 </indexterm>
208
209 <indexterm zone="dhcp dhcp-config">
210 <primary sortas="e-etc-dhcpd.conf">/etc/dhcpd.conf</primary>
211 </indexterm>
212
213 </sect3>
214
215 <sect3 id='dhcp-init'>
216 <title>Configuration Information</title>
217
218 <para>Information on configuring the DHCP client can be
219 found in <xref linkend="basicnet-connect"/>.</para>
220
221 <para>Note that you only need the DHCP server if you want to issue
222 LAN addresses over your network. The DHCP client doesn't need this
223 script to be used. Also note that this script is coded for the
224 <emphasis role="strong">eth1</emphasis> interface, which may need
225 to be modified for your hardware configuration.</para>
226
227 <para>Install the <filename>/etc/rc.d/init.d/dhcp</filename>
228 init script included in the <xref linkend="bootscripts"/>
229 package.</para>
230
231 <indexterm zone="dhcp dhcp-init">
232 <primary sortas="f-dhcp">dhcpd</primary>
233 </indexterm>
234
235<screen role="root"><userinput>make install-dhcp</userinput></screen>
236
237 <para>The lease file must exist on startup. The following command will
238 satisfy that requirement:</para>
239
240<screen role="root"><userinput>touch /var/state/dhcp/dhcpd.leases</userinput></screen>
241
242 <para>The following commands will create a base configuration file
243 for a DHCP server. There are several options that you may want to
244 add (information that is passed back to the DHCP client) and those
245 are covered in the man pages for <filename>dhcp.conf</filename>.</para>
246
247<screen role="root"><userinput>cat &gt; /etc/dhcpd.conf &lt;&lt; "EOF"
248<literal>default-lease-time 72000;
249max-lease-time 144000;
250
251subnet <replaceable>&lt;192.168.5.0&gt;</replaceable> netmask <replaceable>&lt;255.255.255.0&gt;</replaceable> {
252 range <replaceable>&lt;192.168.5.10&gt; &lt;192.168.5.240&gt;</replaceable>;
253 option broadcast-address <replaceable>&lt;192.168.5.255&gt;</replaceable>;
254 option routers <replaceable>&lt;192.168.5.1&gt;</replaceable>;
255}</literal>
256EOF</userinput></screen>
257
258 <para>All addresses should be changed to meet your circumstance.</para>
259
260 </sect3>
261
262 </sect2>
263
264 <sect2 role="content">
265 <title>Contents</title>
266
267 <segmentedlist>
268 <segtitle>Installed Programs</segtitle>
269 <segtitle>Installed Libraries</segtitle>
270 <segtitle>Installed Directories</segtitle>
271
272 <seglistitem>
273 <seg>dhcpd, dhcrelay, dhclient, dhclient-script, and omshell</seg>
274 <seg>libbdhcpctl.a, libdst.a, libomapi.a</seg>
275 <seg>/var/state/dhcp, /usr/include/omapip, and /usr/include/isi-dhcp</seg>
276 </seglistitem>
277 </segmentedlist>
278
279 <variablelist>
280 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
281 <?dbfo list-presentation="list"?>
282 <?dbhtml list-presentation="table"?>
283
284 <varlistentry id="dhclient">
285 <term><command>dhclient</command></term>
286 <listitem>
287 <para>is the implementation of the DHCP client.</para>
288 <indexterm zone="dhcp dhclient">
289 <primary sortas="b-dhclient">dhclient</primary>
290 </indexterm>
291 </listitem>
292 </varlistentry>
293
294 <varlistentry id="dhclient-script">
295 <term><command>dhclient-script</command></term>
296 <listitem>
297 <para>is used by dhclient to (re)configure interfaces. It can make
298 extra changes by invoking custom dhclient-{entry,exit}-hooks.</para>
299 <indexterm zone="dhcp dhclient-script">
300 <primary sortas="b-dhclient-script">dhclient-script</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="dhcpd">
306 <term><command>dhcpd</command></term>
307 <listitem>
308 <para>implements Dynamic Host Configuration Protocol (DHCP) and
309 Internet Bootstrap Protocol (BOOTP) requests for network
310 addresses.</para>
311 <indexterm zone="dhcp dhcpd">
312 <primary sortas="b-dhcpd">dhcpd</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="dhcrelay">
318 <term><command>dhcrelay</command></term>
319 <listitem>
320 <para>provides a means to accept DHCP and BOOTP requests on a subnet
321 without a DHCP server and relay them to a DHCP server on another
322 subnet.</para>
323 <indexterm zone="dhcp dhcrelay">
324 <primary sortas="b-dhcrelay">dhcrelay</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="omshell">
330 <term><command>omshell</command></term>
331 <listitem>
332 <para> provides an interactive way to connect to, query, and
333 possibly change, the ISC DHCP Server's state via OMAPI, the
334 Object Management API.</para>
335 <indexterm zone="dhcp omshell">
336 <primary sortas="b-omshell">omshell</primary>
337 </indexterm>
338 </listitem>
339 </varlistentry>
340
341 </variablelist>
342
343 </sect2>
344
345</sect1>
Note: See TracBrowser for help on using the repository browser.