source: networking/connect/dhcp.xml@ d591de4

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 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 d591de4 was 196d393, checked in by Pierre Labastie <pieere@…>, 10 years ago

Change to Kernel Configuration layout in "networking" chapter

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

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