[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;
|
---|
[fa3e12e1] | 6 | <!-- isc have a weird way of offering the tarballs and without dots in version!
|
---|
| 7 | FIXME - change hardcoded 423s in http url and version in ftp when upgrading -->
|
---|
[ac02266] | 8 | <!ENTITY dhcp-download-http " ">
|
---|
| 9 | <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
---|
| 10 | <!ENTITY dhcp-md5sum "14f57fd580d01633d0fad4809007a801">
|
---|
[fa3e12e1] | 11 | <!ENTITY dhcp-size "9.1 MB">
|
---|
[ac02266] | 12 | <!ENTITY dhcp-buildsize "192 MB (client and server), 140MB client only, 172MB server only">
|
---|
[fa3e12e1] | 13 | <!ENTITY dhcp-time "0.7 SBU (client and server, or server), 0.6 SBU client only ">
|
---|
[0931098] | 14 | ]>
|
---|
| 15 |
|
---|
[40330fcd] | 16 | <sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
|
---|
[6ad98e12] | 17 | <?dbhtml filename="dhcp.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <othername>$LastChangedBy$</othername>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
| 24 | <title>DHCP-&dhcp-version;</title>
|
---|
| 25 |
|
---|
| 26 | <indexterm zone="dhcp">
|
---|
| 27 | <primary sortas="a-dhcp">Dhcp</primary>
|
---|
| 28 | </indexterm>
|
---|
| 29 |
|
---|
| 30 | <sect2 role="package">
|
---|
| 31 | <title>Introduction to DHCP</title>
|
---|
| 32 |
|
---|
| 33 | <para>The <application>DHCP</application> package contains both the client
|
---|
| 34 | and server programs for DHCP. <command>dhclient</command> (the client) is
|
---|
| 35 | useful for connecting your computer to a network which uses DHCP to assign
|
---|
| 36 | network addresses. <command>dhcpd</command> (the server) is useful for
|
---|
| 37 | assigning network addresses on your private network.</para>
|
---|
| 38 |
|
---|
[fa3e12e1] | 39 | &lfs70_checked;
|
---|
| 40 |
|
---|
[6ad98e12] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
| 44 | <para>Download (HTTP): <ulink url="&dhcp-download-http;"/></para>
|
---|
| 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (FTP): <ulink url="&dhcp-download-ftp;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download MD5 sum: &dhcp-md5sum;</para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download size: &dhcp-size;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Estimated disk space required: &dhcp-buildsize;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated build time: &dhcp-time;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | </itemizedlist>
|
---|
| 62 |
|
---|
[413bf97] | 63 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 64 | <itemizedlist spacing='compact'>
|
---|
[b89d0335] | 65 | <listitem>
|
---|
[fa3e12e1] | 66 | <para>Recommended Patch (for client):
|
---|
| 67 | <ulink url="&patch-root;/dhcp-&dhcp-version;-iproute2-1.patch"/></para>
|
---|
[b89d0335] | 68 | </listitem>
|
---|
[413bf97] | 69 | <listitem>
|
---|
[d378ea3c] | 70 | <para>Optional Patch:
|
---|
[fa3e12e1] | 71 | <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/></para>
|
---|
[413bf97] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
| 74 |
|
---|
[6ad98e12] | 75 | <bridgehead renderas="sect3">DHCP Dependencies</bridgehead>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[fa3e12e1] | 78 | <para role="required"><xref linkend="net-tools"/> is required at runtime
|
---|
| 79 | by <command>dhclient</command> if you do not use the iproute2 patch.</para>
|
---|
[6ad98e12] | 80 |
|
---|
[3cb0c57] | 81 | <para condition="html" role="usernotes">User Notes:
|
---|
| 82 | <ulink url="&blfs-wiki;/dhcp"/></para>
|
---|
| 83 |
|
---|
[6ad98e12] | 84 | </sect2>
|
---|
| 85 |
|
---|
| 86 | <sect2 role="kernel" id='dhcp-kernel'>
|
---|
| 87 | <title>Kernel Configuration</title>
|
---|
| 88 |
|
---|
[fa3e12e1] | 89 | <para>You must have Packet Socket support (Networking
|
---|
[d378ea3c] | 90 | Support ⇒ Networking Options ⇒ Packet Socket) compiled into
|
---|
[fa3e12e1] | 91 | the kernel. If you do not have IPv6 support (Networking Support ⇒
|
---|
| 92 | Networking Options ⇒ The IPv6 Protocol) compiled in, then you
|
---|
| 93 | must use the missing_ipv6 patch.</para>
|
---|
[6ad98e12] | 94 |
|
---|
| 95 | <indexterm zone="dhcp dhcp-kernel">
|
---|
| 96 | <primary sortas="d-dhcp">DHCP</primary>
|
---|
| 97 | </indexterm>
|
---|
| 98 |
|
---|
| 99 | </sect2>
|
---|
| 100 |
|
---|
| 101 | <sect2 role="installation">
|
---|
| 102 | <title>Installation of DHCP</title>
|
---|
| 103 |
|
---|
[fa3e12e1] | 104 | <para>If you have not compiled IPv6 support into the kernel, apply the
|
---|
| 105 | missing_ipv6 patch</para>
|
---|
[b89d0335] | 106 |
|
---|
[fa3e12e1] | 107 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
---|
[b89d0335] | 108 |
|
---|
[fa3e12e1] | 109 | <para>If you are installing the client, apply the iproute2 patch unless you
|
---|
| 110 | will have installed <application>net-tools</application> by the time you wish
|
---|
| 111 | to use the client:</para>
|
---|
[61e058b] | 112 |
|
---|
[1e9bd536] | 113 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-iproute2-1.patch</userinput></screen>
|
---|
[61e058b] | 114 |
|
---|
[6ad98e12] | 115 | <para>Install <application>DHCP</application> by running
|
---|
| 116 | the following commands:</para>
|
---|
| 117 |
|
---|
[fa3e12e1] | 118 | <screen><userinput>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in &&
|
---|
| 119 | ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
---|
[ac02266] | 120 | --sbindir=/sbin \
|
---|
| 121 | --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
|
---|
| 122 | --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
|
---|
| 123 | --with-cli-lease-file=/var/state/dhclient.leases \
|
---|
| 124 | --with-cli6-lease-file=/var/state/dhclient6.leases &&
|
---|
[fa3e12e1] | 125 | sed -i 's/-Werror//' {client,common,dst,omapip,relay,server,tests}/Makefile</userinput></screen>
|
---|
| 126 |
|
---|
| 127 | <para>If you only wish to build the server, enter:</para>
|
---|
| 128 | <screen><userinput>sed -i 's/ client//' Makefile</userinput></screen>
|
---|
[6ad98e12] | 129 |
|
---|
[fa3e12e1] | 130 | <para>If you only wish to build the client, enter:</para>
|
---|
| 131 | <screen><userinput>sed -i 's/ dhcpctl relay server//' Makefile</userinput></screen>
|
---|
| 132 |
|
---|
| 133 | <para>Build your chosen variant(s) with:</para>
|
---|
| 134 | <screen><userinput>make</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para>To test the results, issue: <command>make check</command></para>
|
---|
[275b1da] | 137 |
|
---|
[6ad98e12] | 138 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[04a6794] | 139 |
|
---|
[ac02266] | 140 | <screen role="root"><userinput>make install &&
|
---|
| 141 | install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 142 |
|
---|
| 143 | <para>The supplied <filename>/etc/dhcpd.conf</filename> (server) and
|
---|
| 144 | <filename>/etc/dhclient.conf</filename> (client) are examples for a
|
---|
| 145 | specific <literal>BSD</literal> system. They are unlikely to be appropriate
|
---|
| 146 | to your needs, but you may wish to read them for ideas before deleting them
|
---|
| 147 | or moving them to a different location.</para>
|
---|
| 148 |
|
---|
[ac02266] | 149 | <para>Now create any needed directories for the leases.</para>
|
---|
[fa3e12e1] | 150 |
|
---|
| 151 | <para>For the server:</para>
|
---|
| 152 |
|
---|
| 153 | <screen role="root"><userinput>mkdir -pv /var/state/dhcp</userinput></screen>
|
---|
| 154 |
|
---|
| 155 | <para>For the client:</para>
|
---|
| 156 | <screen role="root"><userinput>mkdir -pv /var/state</userinput></screen>
|
---|
[0931098] | 157 |
|
---|
[6ad98e12] | 158 | </sect2>
|
---|
[0931098] | 159 |
|
---|
[6ad98e12] | 160 | <sect2 role="commands">
|
---|
| 161 | <title>Command Explanations</title>
|
---|
[0931098] | 162 |
|
---|
[fa3e12e1] | 163 | <para><command>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in</command>
|
---|
| 164 | This command moves the <command>dhcp</command> program to
|
---|
| 165 | <filename class='directory'>/usr/sbin</filename> instead of
|
---|
| 166 | <filename class='directory'>/sbin</filename> because it is not needed
|
---|
| 167 | while the server is booting.</para>
|
---|
| 168 |
|
---|
| 169 | <para><command>--sbindir=/sbin</command> The <command>dhclient</command>
|
---|
| 170 | program is moved to <filename class='directory'>/sbin</filename> instead of
|
---|
| 171 | <filename class='directory'>/usr/sbin</filename> so that it is available
|
---|
| 172 | during boot, e.g. if <filename class='directory'>/usr</filename> is to be
|
---|
| 173 | an <literal>nfs</literal> mount.</para>
|
---|
| 174 |
|
---|
| 175 | <para><command>--with-*-lease-files=...</command> By default, lease files
|
---|
| 176 | are placed in <filename class='directory'>/var/db</filename> which is an
|
---|
| 177 | anachronism.</para>
|
---|
| 178 |
|
---|
| 179 | <para><command>sed -i 's/-Werror//' {client,common,...}/Makefile</command> -
|
---|
| 180 | the Makefiles in this package add <literal>-Werror</literal> to the
|
---|
| 181 | <literal>CFLAGS</literal>. On recent versions of <application>gcc</application>
|
---|
| 182 | more things, particularly unused variables, create warnings. The
|
---|
| 183 | <literal>-Werror</literal> flag causes warnings to break the build, so we
|
---|
| 184 | remove it where necessary.</para>
|
---|
| 185 |
|
---|
| 186 | <para><command>sed -i 's/ something//' Makefile</command> - this stops the
|
---|
| 187 | build from entering the director(y,ies) named here.</para>
|
---|
| 188 |
|
---|
| 189 | <para><option>rm -v /usr/lib/lib{dhcpctl,dst,omapi}.a</option> - there is
|
---|
| 190 | no easy way to prevent these static libraries being installed, but they are
|
---|
| 191 | only needed during the build of this package. <filename>libdhcpctl.a</filename>
|
---|
| 192 | is only installed if you build the server.</para>
|
---|
[0931098] | 193 |
|
---|
[6ad98e12] | 194 | </sect2>
|
---|
[0931098] | 195 |
|
---|
[6ad98e12] | 196 | <sect2 role="configuration">
|
---|
| 197 | <title>Configuring DHCP</title>
|
---|
[0931098] | 198 |
|
---|
[6ad98e12] | 199 | <sect3 id='dhcp-config'>
|
---|
| 200 | <title>Config Files</title>
|
---|
[04a6794] | 201 |
|
---|
[6ad98e12] | 202 | <para><filename>/etc/dhclient.conf</filename> and
|
---|
| 203 | <filename>/etc/dhcpd.conf</filename></para>
|
---|
[04a6794] | 204 |
|
---|
[6ad98e12] | 205 | <indexterm zone="dhcp dhcp-config">
|
---|
| 206 | <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
|
---|
| 207 | </indexterm>
|
---|
[04a6794] | 208 |
|
---|
[6ad98e12] | 209 | <indexterm zone="dhcp dhcp-config">
|
---|
| 210 | <primary sortas="e-etc-dhcpd.conf">/etc/dhcpd.conf</primary>
|
---|
| 211 | </indexterm>
|
---|
[0931098] | 212 |
|
---|
[6ad98e12] | 213 | </sect3>
|
---|
[0931098] | 214 |
|
---|
[6ad98e12] | 215 | <sect3 id='dhcp-init'>
|
---|
| 216 | <title>Configuration Information</title>
|
---|
[0931098] | 217 |
|
---|
[6ad98e12] | 218 | <para>Information on configuring the DHCP client can be
|
---|
[a324403] | 219 | found in <xref linkend="basicnet-connect"/>.</para>
|
---|
[0931098] | 220 |
|
---|
[6ad98e12] | 221 | <para>Note that you only need the DHCP server if you want to issue
|
---|
| 222 | LAN addresses over your network. The DHCP client doesn't need this
|
---|
| 223 | script to be used. Also note that this script is coded for the
|
---|
| 224 | <emphasis role="strong">eth1</emphasis> interface, which may need
|
---|
| 225 | to be modified for your hardware configuration.</para>
|
---|
[4774914f] | 226 |
|
---|
[6ad98e12] | 227 | <para>Install the <filename>/etc/rc.d/init.d/dhcp</filename>
|
---|
[5254d12] | 228 | init script included in the <xref linkend="bootscripts"/>
|
---|
[6ad98e12] | 229 | package.</para>
|
---|
[04a6794] | 230 |
|
---|
[6ad98e12] | 231 | <indexterm zone="dhcp dhcp-init">
|
---|
| 232 | <primary sortas="f-dhcp">dhcpd</primary>
|
---|
| 233 | </indexterm>
|
---|
[0931098] | 234 |
|
---|
[6ad98e12] | 235 | <screen role="root"><userinput>make install-dhcp</userinput></screen>
|
---|
[0931098] | 236 |
|
---|
[6ad98e12] | 237 | <para>The lease file must exist on startup. The following command will
|
---|
| 238 | satisfy that requirement:</para>
|
---|
[0931098] | 239 |
|
---|
[6ad98e12] | 240 | <screen role="root"><userinput>touch /var/state/dhcp/dhcpd.leases</userinput></screen>
|
---|
[0931098] | 241 |
|
---|
[6ad98e12] | 242 | <para>The following commands will create a base configuration file
|
---|
| 243 | for a DHCP server. There are several options that you may want to
|
---|
| 244 | add (information that is passed back to the DHCP client) and those
|
---|
| 245 | are covered in the man pages for <filename>dhcp.conf</filename>.</para>
|
---|
| 246 |
|
---|
| 247 | <screen role="root"><userinput>cat > /etc/dhcpd.conf << "EOF"
|
---|
| 248 | <literal>default-lease-time 72000;
|
---|
[0931098] | 249 | max-lease-time 144000;
|
---|
| 250 |
|
---|
[3cb0c57] | 251 | subnet <replaceable><192.168.5.0></replaceable> netmask <replaceable><255.255.255.0></replaceable> {
|
---|
[d378ea3c] | 252 | range <replaceable><192.168.5.10> <192.168.5.240></replaceable>;
|
---|
[3cb0c57] | 253 | option broadcast-address <replaceable><192.168.5.255></replaceable>;
|
---|
| 254 | option routers <replaceable><192.168.5.1></replaceable>;
|
---|
[6ad98e12] | 255 | }</literal>
|
---|
| 256 | EOF</userinput></screen>
|
---|
| 257 |
|
---|
| 258 | <para>All addresses should be changed to meet your circumstance.</para>
|
---|
| 259 |
|
---|
| 260 | </sect3>
|
---|
| 261 |
|
---|
| 262 | </sect2>
|
---|
| 263 |
|
---|
| 264 | <sect2 role="content">
|
---|
| 265 | <title>Contents</title>
|
---|
| 266 |
|
---|
| 267 | <segmentedlist>
|
---|
| 268 | <segtitle>Installed Programs</segtitle>
|
---|
| 269 | <segtitle>Installed Libraries</segtitle>
|
---|
| 270 | <segtitle>Installed Directories</segtitle>
|
---|
| 271 |
|
---|
| 272 | <seglistitem>
|
---|
| 273 | <seg>dhcpd, dhcrelay, dhclient, dhclient-script, and omshell</seg>
|
---|
[fa3e12e1] | 274 | <seg>libbdhcpctl.a, libdst.a, libomapi.a</seg>
|
---|
[6ad98e12] | 275 | <seg>/var/state/dhcp, /usr/include/omapip, and /usr/include/isi-dhcp</seg>
|
---|
| 276 | </seglistitem>
|
---|
| 277 | </segmentedlist>
|
---|
| 278 |
|
---|
| 279 | <variablelist>
|
---|
| 280 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 281 | <?dbfo list-presentation="list"?>
|
---|
| 282 | <?dbhtml list-presentation="table"?>
|
---|
| 283 |
|
---|
| 284 | <varlistentry id="dhclient">
|
---|
| 285 | <term><command>dhclient</command></term>
|
---|
| 286 | <listitem>
|
---|
| 287 | <para>is the implementation of the DHCP client.</para>
|
---|
| 288 | <indexterm zone="dhcp dhclient">
|
---|
| 289 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 290 | </indexterm>
|
---|
| 291 | </listitem>
|
---|
| 292 | </varlistentry>
|
---|
| 293 |
|
---|
[fa3e12e1] | 294 | <varlistentry id="dhclient-script">
|
---|
| 295 | <term><command>dhclient-script</command></term>
|
---|
| 296 | <listitem>
|
---|
| 297 | <para>is used by dhclient to (re)configure interfaces. It can make
|
---|
| 298 | extra changes by invoking custom dhclient-{entry,exit}-hooks.</para>
|
---|
| 299 | <indexterm zone="dhcp dhclient-script">
|
---|
| 300 | <primary sortas="b-dhclient-script">dhclient-script</primary>
|
---|
| 301 | </indexterm>
|
---|
| 302 | </listitem>
|
---|
| 303 | </varlistentry>
|
---|
| 304 |
|
---|
[6ad98e12] | 305 | <varlistentry id="dhcpd">
|
---|
| 306 | <term><command>dhcpd</command></term>
|
---|
| 307 | <listitem>
|
---|
| 308 | <para>implements Dynamic Host Configuration Protocol (DHCP) and
|
---|
| 309 | Internet Bootstrap Protocol (BOOTP) requests for network
|
---|
| 310 | addresses.</para>
|
---|
| 311 | <indexterm zone="dhcp dhcpd">
|
---|
| 312 | <primary sortas="b-dhcpd">dhcpd</primary>
|
---|
| 313 | </indexterm>
|
---|
| 314 | </listitem>
|
---|
| 315 | </varlistentry>
|
---|
| 316 |
|
---|
| 317 | <varlistentry id="dhcrelay">
|
---|
| 318 | <term><command>dhcrelay</command></term>
|
---|
| 319 | <listitem>
|
---|
| 320 | <para>provides a means to accept DHCP and BOOTP requests on a subnet
|
---|
| 321 | without a DHCP server and relay them to a DHCP server on another
|
---|
| 322 | subnet.</para>
|
---|
| 323 | <indexterm zone="dhcp dhcrelay">
|
---|
| 324 | <primary sortas="b-dhcrelay">dhcrelay</primary>
|
---|
| 325 | </indexterm>
|
---|
| 326 | </listitem>
|
---|
| 327 | </varlistentry>
|
---|
| 328 |
|
---|
| 329 | <varlistentry id="omshell">
|
---|
| 330 | <term><command>omshell</command></term>
|
---|
| 331 | <listitem>
|
---|
| 332 | <para> provides an interactive way to connect to, query, and
|
---|
| 333 | possibly change, the ISC DHCP Server's state via OMAPI, the
|
---|
| 334 | Object Management API.</para>
|
---|
| 335 | <indexterm zone="dhcp omshell">
|
---|
| 336 | <primary sortas="b-omshell">omshell</primary>
|
---|
| 337 | </indexterm>
|
---|
| 338 | </listitem>
|
---|
| 339 | </varlistentry>
|
---|
| 340 |
|
---|
| 341 | </variablelist>
|
---|
| 342 |
|
---|
| 343 | </sect2>
|
---|
[04a6794] | 344 |
|
---|
[f45b1953] | 345 | </sect1>
|
---|