source: networking/connect/dhcp.xml@ 48bcac9

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.0 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt 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 48bcac9 was 48bcac9, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Tag dependencies for kf5

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

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