source: networking/connect/dhcp.xml@ 5fccdfc

10.0 10.1 11.0 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 5fccdfc was 5fccdfc, checked in by Pierre Labastie <pieere@…>, 18 months ago

Fix vinagre, transcode and dhcp for GCC 10

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

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