[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">
|
---|
[8fa3fc3] | 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">
|
---|
[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 |
|
---|
[d42fa7ee] | 40 | &lfs91_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 ---> [CONFIG_NET]
|
---|
[196d393] | 105 | Networking options --->
|
---|
[321c5a2] | 106 | <*> Packet socket [CONFIG_PACKET]
|
---|
| 107 | <*> The IPv6 Protocol ---> [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 - - -> [CONFIG_NET]
|
---|
| 114 | Networking Options - - ->
|
---|
| 115 | <*> The IPv6 Protocol - - -> [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 |
|
---|
[5fccdfc] | 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 &&
|
---|
| 135 | sed -r '/u.*(local|remote)_port/d' \
|
---|
| 136 | -i client/dhclient.c \
|
---|
| 137 | relay/dhcrelay.c</userinput></screen>
|
---|
| 138 |
|
---|
[3f7242a4] | 139 | <note>
|
---|
| 140 | <para>
|
---|
| 141 | This package does not support parallel build.
|
---|
| 142 | </para>
|
---|
| 143 | </note>
|
---|
[d60f0d5] | 144 | <!-- This should not be needed any more. Visual check appears to handle it.
|
---|
[697cb83f] | 145 | <para>
|
---|
| 146 | If you have not compiled IPv6 support into the kernel, apply the
|
---|
| 147 | missing_ipv6 patch:
|
---|
| 148 | </para>
|
---|
[b89d0335] | 149 |
|
---|
[fa3e12e1] | 150 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
---|
[d60f0d5] | 151 | -->
|
---|
[b33c421] | 152 | <note>
|
---|
| 153 | <para>
|
---|
| 154 | Be careful with the instructions below. The single and
|
---|
[edf9f584] | 155 | double quotes are important because the defined
|
---|
[b33c421] | 156 | variables are used verbatim in the code.
|
---|
| 157 | </para>
|
---|
| 158 | </note>
|
---|
[76b71ab] | 159 |
|
---|
[b33c421] | 160 | <para>
|
---|
| 161 | Install <application>ISC DHCP</application> by running
|
---|
| 162 | the following commands:
|
---|
| 163 | </para>
|
---|
[6ad98e12] | 164 |
|
---|
[44fc64d] | 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\"' \
|
---|
[697cb83f] | 171 | -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
|
---|
[f77c63d0] | 172 | -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &&
|
---|
[d60f0d5] | 173 |
|
---|
[697cb83f] | 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 \
|
---|
[44fc64d] | 180 | --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
|
---|
| 181 | ) &&
|
---|
[3f7242a4] | 182 | make -j1</userinput></screen>
|
---|
[697cb83f] | 183 |
|
---|
| 184 | <para>
|
---|
[d60f0d5] | 185 | <!-- Note: make check builds a library, but otherwise does nothing. -->
|
---|
[1b777da] | 186 | This package does not come with a test suite.
|
---|
[697cb83f] | 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 &&
|
---|
| 196 | mv -v /usr/sbin/dhclient /sbin &&
|
---|
| 197 | install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 198 |
|
---|
[697cb83f] | 199 | <para>
|
---|
[138bdf6] | 200 | Skip to <xref linkend="dhclient-config"/> in order to configure the
|
---|
| 201 | client
|
---|
[697cb83f] | 202 | </para>
|
---|
[6ad98e12] | 203 |
|
---|
[697cb83f] | 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>
|
---|
[fa3e12e1] | 209 |
|
---|
[697cb83f] | 210 | <screen role="root"><userinput>make -C server install</userinput></screen>
|
---|
[fa3e12e1] | 211 |
|
---|
[697cb83f] | 212 | <para>
|
---|
| 213 | Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
|
---|
| 214 | </para>
|
---|
[275b1da] | 215 |
|
---|
[697cb83f] | 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>
|
---|
[04a6794] | 222 |
|
---|
[697cb83f] | 223 | <screen role="root"><userinput>make install &&
|
---|
| 224 | mv -v /usr/sbin/dhclient /sbin &&
|
---|
[ac02266] | 225 | install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 226 |
|
---|
[697cb83f] | 227 | </sect2>
|
---|
[fa3e12e1] | 228 |
|
---|
[697cb83f] | 229 | <sect2 role="configuration">
|
---|
| 230 | <title>Configuring ISC DHCP</title>
|
---|
[fa3e12e1] | 231 |
|
---|
[697cb83f] | 232 | <sect3 id="dhcp-config">
|
---|
| 233 | <title>Config Files</title>
|
---|
[fa3e12e1] | 234 |
|
---|
[697cb83f] | 235 | <para>
|
---|
| 236 | <filename>/etc/dhcp/dhclient.conf</filename> and
|
---|
| 237 | <filename>/etc/dhcp/dhcpd.conf</filename>
|
---|
| 238 | </para>
|
---|
[0931098] | 239 |
|
---|
[697cb83f] | 240 | <indexterm zone="dhcp dhcp-config">
|
---|
| 241 | <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
|
---|
| 242 | </indexterm>
|
---|
[0931098] | 243 |
|
---|
[697cb83f] | 244 | <indexterm zone="dhcp dhcp-config">
|
---|
| 245 | <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
|
---|
| 246 | </indexterm>
|
---|
[0931098] | 247 |
|
---|
[697cb83f] | 248 | </sect3>
|
---|
[fa3e12e1] | 249 |
|
---|
[138bdf6] | 250 | <sect3 id="dhclient-config">
|
---|
[697cb83f] | 251 | <title>Client Configuration</title>
|
---|
| 252 |
|
---|
| 253 | <para>
|
---|
[f77c63d0] | 254 | Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
|
---|
[697cb83f] | 255 | by running the following command as the
|
---|
| 256 | <systemitem class="username">root</systemitem> user:
|
---|
| 257 | </para>
|
---|
| 258 |
|
---|
[37f4f30] | 259 | <screen role="root"><userinput>install -vdm755 /etc/dhcp &&
|
---|
| 260 | cat > /etc/dhcp/dhclient.conf << "EOF"
|
---|
[697cb83f] | 261 | <literal># Begin /etc/dhcp/dhclient.conf
|
---|
| 262 | #
|
---|
| 263 | # Basic dhclient.conf(5)
|
---|
| 264 |
|
---|
| 265 | #prepend domain-name-servers 127.0.0.1;
|
---|
| 266 | request 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;
|
---|
| 270 | require 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>
|
---|
| 278 | EOF</userinput></screen>
|
---|
[fa3e12e1] | 279 |
|
---|
[697cb83f] | 280 | <para>
|
---|
| 281 | See <command>man 5 dhclient.conf</command> for additional options.
|
---|
| 282 | </para>
|
---|
[fa3e12e1] | 283 |
|
---|
[697cb83f] | 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>
|
---|
[fa3e12e1] | 289 |
|
---|
[697cb83f] | 290 | <screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
|
---|
[fa3e12e1] | 291 |
|
---|
[138bdf6] | 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 |
|
---|
[697cb83f] | 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>
|
---|
[0931098] | 319 |
|
---|
[138bdf6] | 320 | <screen role="root" revision="sysv"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen>
|
---|
[0931098] | 321 |
|
---|
[138bdf6] | 322 | <screen role="root" revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
---|
| 323 |
|
---|
| 324 | <para revision="sysv">
|
---|
[697cb83f] | 325 | Replace <replaceable><eth0></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>
|
---|
[0931098] | 329 |
|
---|
[138bdf6] | 330 | <para id="dhclient-service" revision="sysv">
|
---|
[697cb83f] | 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>
|
---|
[04a6794] | 336 |
|
---|
[138bdf6] | 337 | <screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
|
---|
[04a6794] | 338 |
|
---|
[138bdf6] | 339 | <indexterm zone="dhcp dhclient-service" revision="sysv">
|
---|
[697cb83f] | 340 | <primary sortas="f-dhclient">dhclient (service script)</primary>
|
---|
[6ad98e12] | 341 | </indexterm>
|
---|
[04a6794] | 342 |
|
---|
[138bdf6] | 343 | <para id="dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 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 |
|
---|
[138bdf6] | 349 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
---|
[697cb83f] | 350 | <literal>ONBOOT="yes"
|
---|
| 351 | IFACE="eth0"
|
---|
| 352 | SERVICE="dhclient"
|
---|
| 353 | DHCP_START=""
|
---|
| 354 | DHCP_STOP=""
|
---|
| 355 |
|
---|
| 356 | # Set PRINTIP="yes" to have the script print
|
---|
| 357 | # the DHCP assigned IP address
|
---|
| 358 | PRINTIP="no"
|
---|
| 359 |
|
---|
| 360 | # Set PRINTALL="yes" to print the DHCP assigned values for
|
---|
| 361 | # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
---|
| 362 | PRINTALL="no"</literal>
|
---|
| 363 | EOF</userinput></screen>
|
---|
| 364 |
|
---|
[138bdf6] | 365 | <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 366 | <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
|
---|
[6ad98e12] | 367 | </indexterm>
|
---|
[0931098] | 368 |
|
---|
[138bdf6] | 369 | <para revision="sysv">
|
---|
[697cb83f] | 370 | Adjust the file to suit your needs.
|
---|
| 371 | </para>
|
---|
[0931098] | 372 |
|
---|
[138bdf6] | 373 | <para revision="sysv">
|
---|
[697cb83f] | 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>
|
---|
[0931098] | 378 |
|
---|
[138bdf6] | 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>
|
---|
[0931098] | 385 |
|
---|
[138bdf6] | 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>
|
---|
[3c7bd00] | 391 |
|
---|
| 392 | </sect3>
|
---|
| 393 |
|
---|
[697cb83f] | 394 | <sect3 id="dhcpd-config">
|
---|
| 395 | <title>Server Configuration</title>
|
---|
[4774914f] | 396 |
|
---|
[697cb83f] | 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>
|
---|
[04a6794] | 402 |
|
---|
[697cb83f] | 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>
|
---|
[0931098] | 408 |
|
---|
[697cb83f] | 409 | <screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF"
|
---|
| 410 | <literal># Begin /etc/dhcp/dhcpd.conf
|
---|
| 411 | #
|
---|
| 412 | # Example dhcpd.conf(5)
|
---|
[0931098] | 413 |
|
---|
[9fe7d58] | 414 | # Use this to enable / disable dynamic dns updates globally.
|
---|
[697cb83f] | 415 | ddns-update-style none;
|
---|
[0931098] | 416 |
|
---|
[697cb83f] | 417 | # option definitions common to all supported networks...
|
---|
| 418 | option domain-name "example.org";
|
---|
| 419 | option domain-name-servers ns1.example.org, ns2.example.org;
|
---|
[0931098] | 420 |
|
---|
[697cb83f] | 421 | default-lease-time 600;
|
---|
| 422 | max-lease-time 7200;
|
---|
[6ad98e12] | 423 |
|
---|
[697cb83f] | 424 | # This is a very basic subnet declaration.
|
---|
| 425 | subnet 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 | }
|
---|
[0931098] | 429 |
|
---|
[697cb83f] | 430 | # End /etc/dhcp/dhcpd.conf</literal>
|
---|
[6ad98e12] | 431 | EOF</userinput></screen>
|
---|
| 432 |
|
---|
[697cb83f] | 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>
|
---|
[138bdf6] | 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
|
---|
[3c7bd00] | 452 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
| 453 | <xref linkend="systemd-units" revision="systemd"/>
|
---|
[697cb83f] | 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
|
---|
[138bdf6] | 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>
|
---|
[697cb83f] | 468 | will serve the DHCP requests.
|
---|
| 469 | </para>
|
---|
[6ad98e12] | 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>
|
---|
[697cb83f] | 484 | <seg>
|
---|
| 485 | dhclient, dhclient-script, dhcpd, dhcrelay and omshell
|
---|
| 486 | </seg>
|
---|
| 487 | <seg>
|
---|
[f77c63d0] | 488 | libdhcpctl.a and libomapi.a
|
---|
[697cb83f] | 489 | </seg>
|
---|
| 490 | <seg>
|
---|
[03f254d] | 491 | /etc/dhcp,
|
---|
[697cb83f] | 492 | /usr/include/dhcpctl,
|
---|
| 493 | /usr/include/isc-dhcp,
|
---|
| 494 | /usr/include/omapip,
|
---|
| 495 | /var/lib/dhclient and
|
---|
| 496 | /var/lib/dhcpd
|
---|
| 497 | </seg>
|
---|
[6ad98e12] | 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>
|
---|
[697cb83f] | 509 | <para>
|
---|
| 510 | is the implementation of the DHCP client.
|
---|
| 511 | </para>
|
---|
[6ad98e12] | 512 | <indexterm zone="dhcp dhclient">
|
---|
| 513 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 514 | </indexterm>
|
---|
| 515 | </listitem>
|
---|
| 516 | </varlistentry>
|
---|
| 517 |
|
---|
[fa3e12e1] | 518 | <varlistentry id="dhclient-script">
|
---|
| 519 | <term><command>dhclient-script</command></term>
|
---|
| 520 | <listitem>
|
---|
[697cb83f] | 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>
|
---|
[fa3e12e1] | 525 | <indexterm zone="dhcp dhclient-script">
|
---|
| 526 | <primary sortas="b-dhclient-script">dhclient-script</primary>
|
---|
| 527 | </indexterm>
|
---|
| 528 | </listitem>
|
---|
| 529 | </varlistentry>
|
---|
| 530 |
|
---|
[6ad98e12] | 531 | <varlistentry id="dhcpd">
|
---|
| 532 | <term><command>dhcpd</command></term>
|
---|
| 533 | <listitem>
|
---|
[697cb83f] | 534 | <para>
|
---|
| 535 | implements Dynamic Host Configuration Protocol (DHCP) and
|
---|
| 536 | Internet Bootstrap Protocol (BOOTP) requests for network
|
---|
| 537 | addresses.
|
---|
| 538 | </para>
|
---|
[6ad98e12] | 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>
|
---|
[697cb83f] | 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>
|
---|
[6ad98e12] | 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>
|
---|
[697cb83f] | 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>
|
---|
[6ad98e12] | 567 | <indexterm zone="dhcp omshell">
|
---|
| 568 | <primary sortas="b-omshell">omshell</primary>
|
---|
| 569 | </indexterm>
|
---|
| 570 | </listitem>
|
---|
| 571 | </varlistentry>
|
---|
| 572 |
|
---|
| 573 | </variablelist>
|
---|
| 574 |
|
---|
| 575 | </sect2>
|
---|
[04a6794] | 576 |
|
---|
[f45b1953] | 577 | </sect1>
|
---|