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
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">
[188b512]9 <!ENTITY dhcp-md5sum "18c7f4dcbb0a63df25098216d47b1ede">
[edfde25]10 <!ENTITY dhcp-size "10 MB">
[188b512]11 <!ENTITY dhcp-buildsize "171 MB">
12 <!ENTITY dhcp-time "0.8 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>
[138bdf6]33 The <application>ISC DHCP</application> package contains both the client
34 and server programs for DHCP. <command>dhclient</command> (the client) is
[697cb83f]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
[48bcac9]40 &lfs90_checked;
[fa3e12e1]41
[6ad98e12]42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
[697cb83f]45 <para>
46 Download (HTTP): <ulink url="&dhcp-download-http;"/>
47 </para>
[6ad98e12]48 </listitem>
49 <listitem>
[697cb83f]50 <para>
51 Download (FTP): <ulink url="&dhcp-download-ftp;"/>
52 </para>
[6ad98e12]53 </listitem>
54 <listitem>
[697cb83f]55 <para>
56 Download MD5 sum: &dhcp-md5sum;
57 </para>
[6ad98e12]58 </listitem>
59 <listitem>
[697cb83f]60 <para>
61 Download size: &dhcp-size;
62 </para>
[6ad98e12]63 </listitem>
64 <listitem>
[697cb83f]65 <para>
66 Estimated disk space required: &dhcp-buildsize;
67 </para>
[6ad98e12]68 </listitem>
69 <listitem>
[697cb83f]70 <para>
71 Estimated build time: &dhcp-time;
72 </para>
[6ad98e12]73 </listitem>
74 </itemizedlist>
[d60f0d5]75<!--
[413bf97]76 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
[697cb83f]77 <itemizedlist spacing="compact">
[b89d0335]78 <listitem>
[697cb83f]79 <para>
[54f740f]80 Required patch:
[9885c0be]81 <ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
[697cb83f]82 </para>
[b89d0335]83 </listitem>
[413bf97]84 <listitem>
[697cb83f]85 <para>
[54f740f]86 Optional patch:
[697cb83f]87 <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
88 </para>
[413bf97]89 </listitem>
90 </itemizedlist>
[d60f0d5]91-->
[3cb0c57]92 <para condition="html" role="usernotes">User Notes:
[697cb83f]93 <ulink url="&blfs-wiki;/dhcp"/>
94 </para>
[6ad98e12]95 </sect2>
96
[697cb83f]97 <sect2 role="kernel" id="dhcp-kernel">
[6ad98e12]98 <title>Kernel Configuration</title>
99
[697cb83f]100 <para>
[321c5a2]101 You must have Packet Socket support. IPv6 support is optional.
[196d393]102 </para>
103
[321c5a2]104<screen><literal>[*] Networking support ---&gt; [CONFIG_NET]
[196d393]105 Networking options ---&gt;
[321c5a2]106 &lt;*&gt; Packet socket [CONFIG_PACKET]
107 &lt;*&gt; The IPv6 Protocol ---&gt; [CONFIG_IPV6]</literal></screen>
108<!--
[196d393]109 <para>
110 If you do not have IPv6 support:
111 </para>
112
[321c5a2]113<screen><literal>[*] Networking support - - -&gt; [CONFIG_NET]
114 Networking Options - - -&gt;
115 &lt;*&gt; The IPv6 Protocol - - -&gt; [CONFIG_IPV6]</literal></screen>
[196d393]116
117 <para>
118 compiled in, then you must use the <quote>missing_ipv6</quote> patch.
[697cb83f]119 </para>
[321c5a2]120-->
[6ad98e12]121 <indexterm zone="dhcp dhcp-kernel">
[697cb83f]122 <primary sortas="d-DHCP">DHCP</primary>
[6ad98e12]123 </indexterm>
124
125 </sect2>
126
127 <sect2 role="installation">
[697cb83f]128 <title>Installation of ISC DHCP</title>
[6ad98e12]129
[3f7242a4]130 <note>
131 <para>
132 This package does not support parallel build.
133 </para>
134 </note>
[d60f0d5]135<!-- This should not be needed any more. Visual check appears to handle it.
[697cb83f]136 <para>
137 If you have not compiled IPv6 support into the kernel, apply the
138 missing_ipv6 patch:
139 </para>
[b89d0335]140
[fa3e12e1]141<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
[d60f0d5]142-->
[b33c421]143 <note>
144 <para>
145 Be careful with the instructions below. The single and
[edf9f584]146 double quotes are important because the defined
[b33c421]147 variables are used verbatim in the code.
148 </para>
149 </note>
[76b71ab]150
[b33c421]151 <para>
152 Install <application>ISC DHCP</application> by running
153 the following commands:
154 </para>
[6ad98e12]155
[44fc64d]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\"' \
[697cb83f]162 -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
[f77c63d0]163 -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &amp;&amp;
[d60f0d5]164
[697cb83f]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 \
[44fc64d]171 --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
172) &amp;&amp;
[3f7242a4]173make -j1</userinput></screen>
[697cb83f]174
175 <para>
[d60f0d5]176 <!-- Note: make check builds a library, but otherwise does nothing. -->
[1b777da]177 This package does not come with a test suite.
[697cb83f]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>
[fa3e12e1]189
[697cb83f]190 <para>
[138bdf6]191 Skip to <xref linkend="dhclient-config"/> in order to configure the
192 client
[697cb83f]193 </para>
[6ad98e12]194
[697cb83f]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>
[fa3e12e1]200
[697cb83f]201<screen role="root"><userinput>make -C server install</userinput></screen>
[fa3e12e1]202
[697cb83f]203 <para>
204 Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
205 </para>
[275b1da]206
[697cb83f]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>
[04a6794]213
[697cb83f]214<screen role="root"><userinput>make install &amp;&amp;
215mv -v /usr/sbin/dhclient /sbin &amp;&amp;
[ac02266]216install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
[fa3e12e1]217
[697cb83f]218 </sect2>
[fa3e12e1]219
[697cb83f]220 <sect2 role="configuration">
221 <title>Configuring ISC DHCP</title>
[fa3e12e1]222
[697cb83f]223 <sect3 id="dhcp-config">
224 <title>Config Files</title>
[fa3e12e1]225
[697cb83f]226 <para>
227 <filename>/etc/dhcp/dhclient.conf</filename> and
228 <filename>/etc/dhcp/dhcpd.conf</filename>
229 </para>
[0931098]230
[697cb83f]231 <indexterm zone="dhcp dhcp-config">
232 <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
233 </indexterm>
[0931098]234
[697cb83f]235 <indexterm zone="dhcp dhcp-config">
236 <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
237 </indexterm>
[0931098]238
[697cb83f]239 </sect3>
[fa3e12e1]240
[138bdf6]241 <sect3 id="dhclient-config">
[697cb83f]242 <title>Client Configuration</title>
243
244 <para>
[f77c63d0]245 Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
[697cb83f]246 by running the following command as the
247 <systemitem class="username">root</systemitem> user:
248 </para>
249
[37f4f30]250<screen role="root"><userinput>install -vdm755 /etc/dhcp &amp;&amp;
251cat &gt; /etc/dhcp/dhclient.conf &lt;&lt; "EOF"
[697cb83f]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>
[fa3e12e1]270
[697cb83f]271 <para>
272 See <command>man 5 dhclient.conf</command> for additional options.
273 </para>
[fa3e12e1]274
[697cb83f]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>
[fa3e12e1]280
[697cb83f]281<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
[fa3e12e1]282
[138bdf6]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
[697cb83f]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>
[0931098]310
[138bdf6]311<screen role="root" revision="sysv"><userinput>dhclient <replaceable>&lt;eth0&gt;</replaceable></userinput></screen>
[0931098]312
[138bdf6]313<screen role="root" revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
314
315 <para revision="sysv">
[697cb83f]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>
[0931098]320
[138bdf6]321 <para id="dhclient-service" revision="sysv">
[697cb83f]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>
[04a6794]327
[138bdf6]328<screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
[04a6794]329
[138bdf6]330 <indexterm zone="dhcp dhclient-service" revision="sysv">
[697cb83f]331 <primary sortas="f-dhclient">dhclient (service script)</primary>
[6ad98e12]332 </indexterm>
[04a6794]333
[138bdf6]334 <para id="dhclient-ifconfig" revision="sysv">
[697cb83f]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
[138bdf6]340<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
[697cb83f]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
[138bdf6]356 <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
[697cb83f]357 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
[6ad98e12]358 </indexterm>
[0931098]359
[138bdf6]360 <para revision="sysv">
[697cb83f]361 Adjust the file to suit your needs.
362 </para>
[0931098]363
[138bdf6]364 <para revision="sysv">
[697cb83f]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>
[0931098]369
[138bdf6]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>
[0931098]376
[138bdf6]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>
[3c7bd00]382
383 </sect3>
384
[697cb83f]385 <sect3 id="dhcpd-config">
386 <title>Server Configuration</title>
[4774914f]387
[697cb83f]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>
[04a6794]393
[697cb83f]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>
[0931098]399
[697cb83f]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)
[0931098]404
[9fe7d58]405# Use this to enable / disable dynamic dns updates globally.
[697cb83f]406ddns-update-style none;
[0931098]407
[697cb83f]408# option definitions common to all supported networks...
409option domain-name "example.org";
410option domain-name-servers ns1.example.org, ns2.example.org;
[0931098]411
[697cb83f]412default-lease-time 600;
413max-lease-time 7200;
[6ad98e12]414
[697cb83f]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}
[0931098]420
[697cb83f]421# End /etc/dhcp/dhcpd.conf</literal>
[6ad98e12]422EOF</userinput></screen>
423
[697cb83f]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>
[138bdf6]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
[3c7bd00]443 <xref linkend="bootscripts" revision="sysv"/>
444 <xref linkend="systemd-units" revision="systemd"/>
[697cb83f]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
[138bdf6]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>
[697cb83f]459 will serve the DHCP requests.
460 </para>
[6ad98e12]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>
[697cb83f]475 <seg>
476 dhclient, dhclient-script, dhcpd, dhcrelay and omshell
477 </seg>
478 <seg>
[f77c63d0]479 libdhcpctl.a and libomapi.a
[697cb83f]480 </seg>
481 <seg>
[03f254d]482 /etc/dhcp,
[697cb83f]483 /usr/include/dhcpctl,
484 /usr/include/isc-dhcp,
485 /usr/include/omapip,
486 /var/lib/dhclient and
487 /var/lib/dhcpd
488 </seg>
[6ad98e12]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>
[697cb83f]500 <para>
501 is the implementation of the DHCP client.
502 </para>
[6ad98e12]503 <indexterm zone="dhcp dhclient">
504 <primary sortas="b-dhclient">dhclient</primary>
505 </indexterm>
506 </listitem>
507 </varlistentry>
508
[fa3e12e1]509 <varlistentry id="dhclient-script">
510 <term><command>dhclient-script</command></term>
511 <listitem>
[697cb83f]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>
[fa3e12e1]516 <indexterm zone="dhcp dhclient-script">
517 <primary sortas="b-dhclient-script">dhclient-script</primary>
518 </indexterm>
519 </listitem>
520 </varlistentry>
521
[6ad98e12]522 <varlistentry id="dhcpd">
523 <term><command>dhcpd</command></term>
524 <listitem>
[697cb83f]525 <para>
526 implements Dynamic Host Configuration Protocol (DHCP) and
527 Internet Bootstrap Protocol (BOOTP) requests for network
528 addresses.
529 </para>
[6ad98e12]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>
[697cb83f]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>
[6ad98e12]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>
[697cb83f]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>
[6ad98e12]558 <indexterm zone="dhcp omshell">
559 <primary sortas="b-omshell">omshell</primary>
560 </indexterm>
561 </listitem>
562 </varlistentry>
563
564 </variablelist>
565
566 </sect2>
[04a6794]567
[f45b1953]568</sect1>
Note: See TracBrowser for help on using the repository browser.