source: networking/connect/dhcp.xml@ f77c63d0

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since f77c63d0 was f77c63d0, checked in by Douglas R. Reno <renodr@…>, 8 years ago

Update to dhcp-4.3.5
Update to dhcpcd-6.11.5
Update to NetworkManager-1.4.2
Update to network-manager-applet-1.4.2
Update to vala-0.34.1
Update to wpa_supplicant-2.6

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

  • Property mode set to 100644
File size: 17.9 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 "2b5e5b2fa31c2e27e487039d86f83d3f">
10 <!ENTITY dhcp-size "9.6 MB">
11 <!ENTITY dhcp-buildsize "238 MB">
12 <!ENTITY dhcp-time "0.6 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
34 and 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 &lfs7a_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:
102 </para>
103
104<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
105 Networking options ---&gt;
106 &lt;*&gt; Packet socket [CONFIG_PACKET]</literal></screen>
107
108 <para>
109 If you do not have IPv6 support:
110 </para>
111
112<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
113 Networking Options ---&gt;
114 &lt;*&gt; The IPv6 Protocol ---&gt; [CONFIG_IPV6]</literal></screen>
115
116 <para>
117 compiled in, then you must use the <quote>missing_ipv6</quote> patch.
118 </para>
119
120 <indexterm zone="dhcp dhcp-kernel">
121 <primary sortas="d-DHCP">DHCP</primary>
122 </indexterm>
123
124 </sect2>
125
126 <sect2 role="installation">
127 <title>Installation of ISC DHCP</title>
128
129 <note>
130 <para>
131 This package does not support parallel build.
132 </para>
133 </note>
134
135 <para>
136 If you have not compiled IPv6 support into the kernel, apply the
137 missing_ipv6 patch:
138 </para>
139
140<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
141
142 <note>
143 <para>
144 Be careful with the instructions below. The single and
145 double quotes are important because the defined
146 variables are used verbatim in the code.
147 </para>
148 </note>
149
150 <para>
151 Install <application>ISC DHCP</application> by running
152 the following commands:
153 </para>
154
155<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-client_script-1.patch &amp;&amp;
156CFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/sbin/dhclient-script\"' \
157 -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
158 -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &amp;&amp;
159./configure --prefix=/usr \
160 --sysconfdir=/etc/dhcp \
161 --localstatedir=/var \
162 --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
163 --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
164 --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
165 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases &amp;&amp;
166make -j1</userinput></screen>
167
168 <para>
169 <!-- To test the results, issue: <command>make check</command>
170
171 Note: make check builds a library, but otherwise does nothing.
172
173 -->
174 This package does not come with a test suite.
175 </para>
176
177 <para>
178 If you only want to install the <application>ISC DHCP</application> client,
179 issue the following commands as the
180 <systemitem class="username">root</systemitem> user:
181 </para>
182
183<screen role="root"><userinput>make -C client install &amp;&amp;
184mv -v /usr/sbin/dhclient /sbin &amp;&amp;
185install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
186
187 <para>
188 Skip to <xref linkend="dhclient-config"/> in order to configure the
189 client
190 </para>
191
192 <para>
193 If you only want to install the <application>ISC DHCP</application> server,
194 issue the following command as the
195 <systemitem class="username">root</systemitem> user:
196 </para>
197
198<screen role="root"><userinput>make -C server install</userinput></screen>
199
200 <para>
201 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
202 </para>
203
204 <para>
205 Alternatively, you can install whole package which includes the client,
206 server, relay, static libraries and development headers by running the
207 following commands as the
208 <systemitem class="username">root</systemitem> user:
209 </para>
210
211<screen role="root"><userinput>make install &amp;&amp;
212mv -v /usr/sbin/dhclient /sbin &amp;&amp;
213install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
214
215 </sect2>
216
217 <sect2 role="configuration">
218 <title>Configuring ISC DHCP</title>
219
220 <sect3 id="dhcp-config">
221 <title>Config Files</title>
222
223 <para>
224 <filename>/etc/dhcp/dhclient.conf</filename> and
225 <filename>/etc/dhcp/dhcpd.conf</filename>
226 </para>
227
228 <indexterm zone="dhcp dhcp-config">
229 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
230 </indexterm>
231
232 <indexterm zone="dhcp dhcp-config">
233 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
234 </indexterm>
235
236 </sect3>
237
238 <sect3 id="dhclient-config">
239 <title>Client Configuration</title>
240
241 <para>
242 Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
243 by running the following command as the
244 <systemitem class="username">root</systemitem> user:
245 </para>
246
247<screen role="root"><userinput>cat &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
248<literal># Begin /etc/dhcp/dhclient.conf
249#
250# Basic dhclient.conf(5)
251
252#prepend domain-name-servers 127.0.0.1;
253request subnet-mask, broadcast-address, time-offset, routers,
254 domain-name, domain-name-servers, domain-search, host-name,
255 netbios-name-servers, netbios-scope, interface-mtu,
256 ntp-servers;
257require subnet-mask, domain-name-servers;
258#timeout 60;
259#retry 60;
260#reboot 10;
261#select-timeout 5;
262#initial-interval 2;
263
264# End /etc/dhcp/dhclient.conf</literal>
265EOF</userinput></screen>
266
267 <para>
268 See <command>man 5 dhclient.conf</command> for additional options.
269 </para>
270
271 <para>
272 Now create the <filename class="directory">/var/lib/dhclient</filename>
273 directory which will contain DHCP Client leases by running the following
274 command as the <systemitem class="username">root</systemitem> user:
275 </para>
276
277<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
278
279 <para id="dhclient-service-sysd" revision="systemd">
280 If you want to configure network interfaces at boot using
281 <command>dhclient</command>, you need to install the
282 <filename>dhclient@.service</filename> unit included in the
283 <xref linkend="systemd-units"/> package by running the following
284 command as the <systemitem class="username">root</systemitem> user:
285 </para>
286
287 <indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
288 <primary sortas="f-dhclient">dhclient@.service</primary>
289 </indexterm>
290
291<screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
292
293 <note revision="systemd">
294 <para>
295 Make sure that you disable the <command>systemd-networkd</command>
296 service or configure it not to manage the interfaces you want to
297 manage with <command>dhclient</command>.
298 </para>
299 </note>
300
301 <para>
302 At this point you can test if <command>dhclient</command> is
303 behaving as expected by running the following command as the
304 <systemitem class="username">root</systemitem> user:
305 </para>
306
307<screen role="root" revision="sysv"><userinput>dhclient <replaceable>&lt;eth0&gt;</replaceable></userinput></screen>
308
309<screen role="root" revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
310
311 <para revision="sysv">
312 Replace <replaceable>&lt;eth0&gt;</replaceable> with your
313 desired interface. If you want more verbose output, add the
314 <command>-v</command> parameter to the command above.
315 </para>
316
317 <para id="dhclient-service" revision="sysv">
318 If you want to configure network interfaces at boot using
319 <command>dhclient</command>, you need to install the
320 <filename>/lib/services/dhclient</filename> script
321 included in <xref linkend="bootscripts"/> package:
322 </para>
323
324<screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
325
326 <indexterm zone="dhcp dhclient-service" revision="sysv">
327 <primary sortas="f-dhclient">dhclient (service script)</primary>
328 </indexterm>
329
330 <para id="dhclient-ifconfig" revision="sysv">
331 Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
332 configuration file with the following commands as the
333 <systemitem class="username">root</systemitem> user:
334 </para>
335
336<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
337<literal>ONBOOT="yes"
338IFACE="eth0"
339SERVICE="dhclient"
340DHCP_START=""
341DHCP_STOP=""
342
343# Set PRINTIP="yes" to have the script print
344# the DHCP assigned IP address
345PRINTIP="no"
346
347# Set PRINTALL="yes" to print the DHCP assigned values for
348# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
349PRINTALL="no"</literal>
350EOF</userinput></screen>
351
352 <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
353 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
354 </indexterm>
355
356 <para revision="sysv">
357 Adjust the file to suit your needs.
358 </para>
359
360 <para revision="sysv">
361 For more information on the appropriate <envar>DHCP_START</envar>
362 and <envar>DHCP_STOP</envar> values see
363 <command>man 8 dhclient</command>.
364 </para>
365
366 <para revision="systemd">
367 To start <command>dhclient</command> on a specific interface
368 at boot, enable the previously installed systemd unit by
369 running the following command as the
370 <systemitem class="username">root</systemitem> user:
371 </para>
372
373<screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
374
375 <para revision="systemd">
376 Replace <replaceable>eth0</replaceable> with the actual interface name.
377 </para>
378
379 </sect3>
380
381 <sect3 id="dhcpd-config">
382 <title>Server Configuration</title>
383
384 <para>
385 Note that you only need the DHCP server if you want to issue
386 LAN addresses over your network. The DHCP client doesn't need
387 the server in order to function properly.
388 </para>
389
390 <para>
391 Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
392 by running the following command as the
393 <systemitem class="username">root</systemitem> user:
394 </para>
395
396<screen role="root"><userinput>cat &gt; /etc/dhcp/dhcpd.conf &lt;&lt; "EOF"
397<literal># Begin /etc/dhcp/dhcpd.conf
398#
399# Example dhcpd.conf(5)
400
401# Use this to enble / disable dynamic dns updates globally.
402ddns-update-style none;
403
404# option definitions common to all supported networks...
405option domain-name "example.org";
406option domain-name-servers ns1.example.org, ns2.example.org;
407
408default-lease-time 600;
409max-lease-time 7200;
410
411# This is a very basic subnet declaration.
412subnet 10.254.239.0 netmask 255.255.255.224 {
413 range 10.254.239.10 10.254.239.20;
414 option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
415}
416
417# End /etc/dhcp/dhcpd.conf</literal>
418EOF</userinput></screen>
419
420 <para>
421 Adjust the file to suit your needs. See
422 <command>man 5 dhcpd.conf</command> for additional options.
423 </para>
424
425 <para>
426 Now create the <filename class="directory">/var/lib/dhcpd</filename>
427 directory which will contain DHCP Server leases by running the following
428 command as the <systemitem class="username">root</systemitem> user:
429 </para>
430
431<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</userinput></screen>
432
433 <para>
434 If you want to start the DHCP Server at boot, install the
435 <phrase revision="sysv"><filename>/etc/rc.d/init.d/dhcpd</filename>
436 inti script</phrase>
437 <phrase revision="systemd"><filename>dhcpd.service</filename>
438 unit</phrase> included in the
439 <xref linkend="bootscripts" revision="sysv"/>
440 <xref linkend="systemd-units" revision="systemd"/>
441 package:
442 </para>
443
444<screen role="root"><userinput>make install-dhcpd</userinput></screen>
445
446 <indexterm zone="dhcp dhcpd-config">
447 <primary sortas="f-dhcpd">dhcpd</primary>
448 </indexterm>
449
450 <para>
451 You will need to edit the
452 <phrase revision="sysv"><filename>/etc/sysconfig/dhcpd</filename></phrase>
453 <phrase revision="systemd"><filename>/etc/default/dhcpd</filename></phrase>
454 in order to set the interface on which <command>dhcpd</command>
455 will serve the DHCP requests.
456 </para>
457
458 </sect3>
459
460 </sect2>
461
462 <sect2 role="content">
463 <title>Contents</title>
464
465 <segmentedlist>
466 <segtitle>Installed Programs</segtitle>
467 <segtitle>Installed Libraries</segtitle>
468 <segtitle>Installed Directories</segtitle>
469
470 <seglistitem>
471 <seg>
472 dhclient, dhclient-script, dhcpd, dhcrelay and omshell
473 </seg>
474 <seg>
475 libdhcpctl.a and libomapi.a
476 </seg>
477 <seg>
478 /etc/dhcp,
479 /usr/include/dhcpctl,
480 /usr/include/isc-dhcp,
481 /usr/include/omapip,
482 /var/lib/dhclient and
483 /var/lib/dhcpd
484 </seg>
485 </seglistitem>
486 </segmentedlist>
487
488 <variablelist>
489 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
490 <?dbfo list-presentation="list"?>
491 <?dbhtml list-presentation="table"?>
492
493 <varlistentry id="dhclient">
494 <term><command>dhclient</command></term>
495 <listitem>
496 <para>
497 is the implementation of the DHCP client.
498 </para>
499 <indexterm zone="dhcp dhclient">
500 <primary sortas="b-dhclient">dhclient</primary>
501 </indexterm>
502 </listitem>
503 </varlistentry>
504
505 <varlistentry id="dhclient-script">
506 <term><command>dhclient-script</command></term>
507 <listitem>
508 <para>
509 is used by dhclient to (re)configure interfaces. It can make
510 extra changes by invoking custom dhclient-{entry,exit}-hooks.
511 </para>
512 <indexterm zone="dhcp dhclient-script">
513 <primary sortas="b-dhclient-script">dhclient-script</primary>
514 </indexterm>
515 </listitem>
516 </varlistentry>
517
518 <varlistentry id="dhcpd">
519 <term><command>dhcpd</command></term>
520 <listitem>
521 <para>
522 implements Dynamic Host Configuration Protocol (DHCP) and
523 Internet Bootstrap Protocol (BOOTP) requests for network
524 addresses.
525 </para>
526 <indexterm zone="dhcp dhcpd">
527 <primary sortas="b-dhcpd">dhcpd</primary>
528 </indexterm>
529 </listitem>
530 </varlistentry>
531
532 <varlistentry id="dhcrelay">
533 <term><command>dhcrelay</command></term>
534 <listitem>
535 <para>
536 provides a means to accept DHCP and BOOTP requests on a subnet
537 without a DHCP server and relay them to a DHCP server on another
538 subnet.
539 </para>
540 <indexterm zone="dhcp dhcrelay">
541 <primary sortas="b-dhcrelay">dhcrelay</primary>
542 </indexterm>
543 </listitem>
544 </varlistentry>
545
546 <varlistentry id="omshell">
547 <term><command>omshell</command></term>
548 <listitem>
549 <para>
550 provides an interactive way to connect to, query and
551 possibly change the ISC DHCP Server's state via OMAPI, the
552 Object Management API.
553 </para>
554 <indexterm zone="dhcp omshell">
555 <primary sortas="b-omshell">omshell</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559
560 </variablelist>
561
562 </sect2>
563
564</sect1>
Note: See TracBrowser for help on using the repository browser.