source: networking/connect/dhcp.xml@ 443b085

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 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 443b085 was 23ca8a5, checked in by Ken Moffat <ken@…>, 7 years ago

Tag.

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

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