[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 |
|
---|
[f01ae5f] | 7 | <!ENTITY dhcp-download-http "https://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
---|
[697cb83f] | 8 | <!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
---|
[96aff83f] | 9 | <!ENTITY dhcp-md5sum "3089a1ebd20a802ec0870ae337d43907">
|
---|
[8fa3fc3] | 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 | <date>$Date$</date>
|
---|
| 20 | </sect1info>
|
---|
| 21 |
|
---|
| 22 | <title>DHCP-&dhcp-version;</title>
|
---|
| 23 |
|
---|
| 24 | <indexterm zone="dhcp">
|
---|
[697cb83f] | 25 | <primary sortas="a-DHCP">DHCP</primary>
|
---|
[6ad98e12] | 26 | </indexterm>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="package">
|
---|
[697cb83f] | 29 | <title>Introduction to ISC DHCP</title>
|
---|
[6ad98e12] | 30 |
|
---|
[697cb83f] | 31 | <para>
|
---|
[138bdf6] | 32 | The <application>ISC DHCP</application> package contains both the client
|
---|
| 33 | and server programs for DHCP. <command>dhclient</command> (the client) is
|
---|
[697cb83f] | 34 | used for connecting to a network which uses DHCP to assign network
|
---|
| 35 | addresses. <command>dhcpd</command> (the server) is used for assigning
|
---|
| 36 | network addresses on private networks.
|
---|
| 37 | </para>
|
---|
[6ad98e12] | 38 |
|
---|
[e9a55974] | 39 | &lfs110a_checked;
|
---|
[fa3e12e1] | 40 |
|
---|
[6ad98e12] | 41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 42 | <itemizedlist spacing="compact">
|
---|
| 43 | <listitem>
|
---|
[697cb83f] | 44 | <para>
|
---|
| 45 | Download (HTTP): <ulink url="&dhcp-download-http;"/>
|
---|
| 46 | </para>
|
---|
[6ad98e12] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[697cb83f] | 49 | <para>
|
---|
| 50 | Download (FTP): <ulink url="&dhcp-download-ftp;"/>
|
---|
| 51 | </para>
|
---|
[6ad98e12] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[697cb83f] | 54 | <para>
|
---|
| 55 | Download MD5 sum: &dhcp-md5sum;
|
---|
| 56 | </para>
|
---|
[6ad98e12] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[697cb83f] | 59 | <para>
|
---|
| 60 | Download size: &dhcp-size;
|
---|
| 61 | </para>
|
---|
[6ad98e12] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[697cb83f] | 64 | <para>
|
---|
| 65 | Estimated disk space required: &dhcp-buildsize;
|
---|
| 66 | </para>
|
---|
[6ad98e12] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[697cb83f] | 69 | <para>
|
---|
| 70 | Estimated build time: &dhcp-time;
|
---|
| 71 | </para>
|
---|
[6ad98e12] | 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[d60f0d5] | 74 | <!--
|
---|
[413bf97] | 75 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[697cb83f] | 76 | <itemizedlist spacing="compact">
|
---|
[b89d0335] | 77 | <listitem>
|
---|
[697cb83f] | 78 | <para>
|
---|
[54f740f] | 79 | Required patch:
|
---|
[9885c0be] | 80 | <ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
|
---|
[697cb83f] | 81 | </para>
|
---|
[b89d0335] | 82 | </listitem>
|
---|
[413bf97] | 83 | <listitem>
|
---|
[697cb83f] | 84 | <para>
|
---|
[54f740f] | 85 | Optional patch:
|
---|
[697cb83f] | 86 | <ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
|
---|
| 87 | </para>
|
---|
[413bf97] | 88 | </listitem>
|
---|
| 89 | </itemizedlist>
|
---|
[d60f0d5] | 90 | -->
|
---|
[3cb0c57] | 91 | <para condition="html" role="usernotes">User Notes:
|
---|
[697cb83f] | 92 | <ulink url="&blfs-wiki;/dhcp"/>
|
---|
| 93 | </para>
|
---|
[6ad98e12] | 94 | </sect2>
|
---|
| 95 |
|
---|
[697cb83f] | 96 | <sect2 role="kernel" id="dhcp-kernel">
|
---|
[6ad98e12] | 97 | <title>Kernel Configuration</title>
|
---|
| 98 |
|
---|
[697cb83f] | 99 | <para>
|
---|
[321c5a2] | 100 | You must have Packet Socket support. IPv6 support is optional.
|
---|
[196d393] | 101 | </para>
|
---|
| 102 |
|
---|
[321c5a2] | 103 | <screen><literal>[*] Networking support ---> [CONFIG_NET]
|
---|
[196d393] | 104 | Networking options --->
|
---|
[321c5a2] | 105 | <*> Packet socket [CONFIG_PACKET]
|
---|
| 106 | <*> The IPv6 Protocol ---> [CONFIG_IPV6]</literal></screen>
|
---|
| 107 | <!--
|
---|
[196d393] | 108 | <para>
|
---|
| 109 | If you do not have IPv6 support:
|
---|
| 110 | </para>
|
---|
| 111 |
|
---|
[321c5a2] | 112 | <screen><literal>[*] Networking support - - -> [CONFIG_NET]
|
---|
| 113 | Networking Options - - ->
|
---|
| 114 | <*> The IPv6 Protocol - - -> [CONFIG_IPV6]</literal></screen>
|
---|
[196d393] | 115 |
|
---|
| 116 | <para>
|
---|
| 117 | compiled in, then you must use the <quote>missing_ipv6</quote> patch.
|
---|
[697cb83f] | 118 | </para>
|
---|
[321c5a2] | 119 | -->
|
---|
[6ad98e12] | 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 |
|
---|
[5fccdfc] | 129 | <para>
|
---|
| 130 | First, fix a build issue with GCC 10 and later:
|
---|
| 131 | </para>
|
---|
| 132 |
|
---|
| 133 | <screen><userinput>sed -i '/o.*dhcp_type/d' server/mdb.c &&
|
---|
| 134 | sed -r '/u.*(local|remote)_port/d' \
|
---|
| 135 | -i client/dhclient.c \
|
---|
| 136 | relay/dhcrelay.c</userinput></screen>
|
---|
| 137 |
|
---|
[3f7242a4] | 138 | <note>
|
---|
| 139 | <para>
|
---|
| 140 | This package does not support parallel build.
|
---|
| 141 | </para>
|
---|
| 142 | </note>
|
---|
[d60f0d5] | 143 | <!-- This should not be needed any more. Visual check appears to handle it.
|
---|
[697cb83f] | 144 | <para>
|
---|
| 145 | If you have not compiled IPv6 support into the kernel, apply the
|
---|
| 146 | missing_ipv6 patch:
|
---|
| 147 | </para>
|
---|
[b89d0335] | 148 |
|
---|
[fa3e12e1] | 149 | <screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
---|
[d60f0d5] | 150 | -->
|
---|
[b33c421] | 151 | <note>
|
---|
| 152 | <para>
|
---|
| 153 | Be careful with the instructions below. The single and
|
---|
[edf9f584] | 154 | double quotes are important because the defined
|
---|
[b33c421] | 155 | variables are used verbatim in the code.
|
---|
| 156 | </para>
|
---|
| 157 | </note>
|
---|
[76b71ab] | 158 |
|
---|
[b33c421] | 159 | <para>
|
---|
| 160 | Install <application>ISC DHCP</application> by running
|
---|
| 161 | the following commands:
|
---|
| 162 | </para>
|
---|
[6ad98e12] | 163 |
|
---|
[44fc64d] | 164 | <!--
|
---|
| 165 | Running ( export CFLAGS=... ./configure ... ) in a subshell
|
---|
| 166 | preserves CFLAGS if they are set in environment
|
---|
| 167 | -->
|
---|
[0e1ef1cc] | 168 | <screen><userinput>( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \
|
---|
[095d076] | 169 | -D_PATH_DHCLIENT_SCRIPT='\"/usr/sbin/dhclient-script\"' \
|
---|
[697cb83f] | 170 | -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
|
---|
[f77c63d0] | 171 | -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &&
|
---|
[d60f0d5] | 172 |
|
---|
[697cb83f] | 173 | ./configure --prefix=/usr \
|
---|
| 174 | --sysconfdir=/etc/dhcp \
|
---|
| 175 | --localstatedir=/var \
|
---|
| 176 | --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
|
---|
| 177 | --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
|
---|
| 178 | --with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
|
---|
[44fc64d] | 179 | --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
|
---|
| 180 | ) &&
|
---|
[3f7242a4] | 181 | make -j1</userinput></screen>
|
---|
[697cb83f] | 182 |
|
---|
| 183 | <para>
|
---|
[d60f0d5] | 184 | <!-- Note: make check builds a library, but otherwise does nothing. -->
|
---|
[1b777da] | 185 | This package does not come with a test suite.
|
---|
[697cb83f] | 186 | </para>
|
---|
| 187 |
|
---|
| 188 | <para>
|
---|
| 189 | If you only want to install the <application>ISC DHCP</application> client,
|
---|
| 190 | issue the following commands as the
|
---|
| 191 | <systemitem class="username">root</systemitem> user:
|
---|
| 192 | </para>
|
---|
| 193 |
|
---|
[095d076] | 194 | <screen role="root"><userinput>make -C client install &&
|
---|
| 195 | install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 196 |
|
---|
[697cb83f] | 197 | <para>
|
---|
[138bdf6] | 198 | Skip to <xref linkend="dhclient-config"/> in order to configure the
|
---|
| 199 | client
|
---|
[697cb83f] | 200 | </para>
|
---|
[6ad98e12] | 201 |
|
---|
[697cb83f] | 202 | <para>
|
---|
| 203 | If you only want to install the <application>ISC DHCP</application> server,
|
---|
| 204 | issue the following command as the
|
---|
| 205 | <systemitem class="username">root</systemitem> user:
|
---|
| 206 | </para>
|
---|
[fa3e12e1] | 207 |
|
---|
[697cb83f] | 208 | <screen role="root"><userinput>make -C server install</userinput></screen>
|
---|
[fa3e12e1] | 209 |
|
---|
[697cb83f] | 210 | <para>
|
---|
| 211 | Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
|
---|
| 212 | </para>
|
---|
[275b1da] | 213 |
|
---|
[697cb83f] | 214 | <para>
|
---|
| 215 | Alternatively, you can install whole package which includes the client,
|
---|
| 216 | server, relay, static libraries and development headers by running the
|
---|
| 217 | following commands as the
|
---|
| 218 | <systemitem class="username">root</systemitem> user:
|
---|
| 219 | </para>
|
---|
[04a6794] | 220 |
|
---|
[095d076] | 221 | <screen role="root"><userinput>make install &&
|
---|
| 222 | install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 223 |
|
---|
[697cb83f] | 224 | </sect2>
|
---|
[fa3e12e1] | 225 |
|
---|
[697cb83f] | 226 | <sect2 role="configuration">
|
---|
| 227 | <title>Configuring ISC DHCP</title>
|
---|
[fa3e12e1] | 228 |
|
---|
[697cb83f] | 229 | <sect3 id="dhcp-config">
|
---|
| 230 | <title>Config Files</title>
|
---|
[fa3e12e1] | 231 |
|
---|
[697cb83f] | 232 | <para>
|
---|
| 233 | <filename>/etc/dhcp/dhclient.conf</filename> and
|
---|
| 234 | <filename>/etc/dhcp/dhcpd.conf</filename>
|
---|
| 235 | </para>
|
---|
[0931098] | 236 |
|
---|
[697cb83f] | 237 | <indexterm zone="dhcp dhcp-config">
|
---|
| 238 | <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
|
---|
| 239 | </indexterm>
|
---|
[0931098] | 240 |
|
---|
[697cb83f] | 241 | <indexterm zone="dhcp dhcp-config">
|
---|
| 242 | <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
|
---|
| 243 | </indexterm>
|
---|
[0931098] | 244 |
|
---|
[697cb83f] | 245 | </sect3>
|
---|
[fa3e12e1] | 246 |
|
---|
[138bdf6] | 247 | <sect3 id="dhclient-config">
|
---|
[697cb83f] | 248 | <title>Client Configuration</title>
|
---|
| 249 |
|
---|
| 250 | <para>
|
---|
[f77c63d0] | 251 | Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
|
---|
[697cb83f] | 252 | by running the following command as the
|
---|
| 253 | <systemitem class="username">root</systemitem> user:
|
---|
| 254 | </para>
|
---|
| 255 |
|
---|
[37f4f30] | 256 | <screen role="root"><userinput>install -vdm755 /etc/dhcp &&
|
---|
| 257 | cat > /etc/dhcp/dhclient.conf << "EOF"
|
---|
[697cb83f] | 258 | <literal># Begin /etc/dhcp/dhclient.conf
|
---|
| 259 | #
|
---|
| 260 | # Basic dhclient.conf(5)
|
---|
| 261 |
|
---|
| 262 | #prepend domain-name-servers 127.0.0.1;
|
---|
| 263 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 264 | domain-name, domain-name-servers, domain-search, host-name,
|
---|
| 265 | netbios-name-servers, netbios-scope, interface-mtu,
|
---|
| 266 | ntp-servers;
|
---|
| 267 | require subnet-mask, domain-name-servers;
|
---|
| 268 | #timeout 60;
|
---|
| 269 | #retry 60;
|
---|
| 270 | #reboot 10;
|
---|
| 271 | #select-timeout 5;
|
---|
| 272 | #initial-interval 2;
|
---|
| 273 |
|
---|
| 274 | # End /etc/dhcp/dhclient.conf</literal>
|
---|
| 275 | EOF</userinput></screen>
|
---|
[fa3e12e1] | 276 |
|
---|
[697cb83f] | 277 | <para>
|
---|
| 278 | See <command>man 5 dhclient.conf</command> for additional options.
|
---|
| 279 | </para>
|
---|
[fa3e12e1] | 280 |
|
---|
[697cb83f] | 281 | <para>
|
---|
| 282 | Now create the <filename class="directory">/var/lib/dhclient</filename>
|
---|
| 283 | directory which will contain DHCP Client leases by running the following
|
---|
| 284 | command as the <systemitem class="username">root</systemitem> user:
|
---|
| 285 | </para>
|
---|
[fa3e12e1] | 286 |
|
---|
[697cb83f] | 287 | <screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
|
---|
[fa3e12e1] | 288 |
|
---|
[138bdf6] | 289 | <para id="dhclient-service-sysd" revision="systemd">
|
---|
| 290 | If you want to configure network interfaces at boot using
|
---|
| 291 | <command>dhclient</command>, you need to install the
|
---|
| 292 | <filename>dhclient@.service</filename> unit included in the
|
---|
| 293 | <xref linkend="systemd-units"/> package by running the following
|
---|
| 294 | command as the <systemitem class="username">root</systemitem> user:
|
---|
| 295 | </para>
|
---|
| 296 |
|
---|
| 297 | <indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
|
---|
| 298 | <primary sortas="f-dhclient">dhclient@.service</primary>
|
---|
| 299 | </indexterm>
|
---|
| 300 |
|
---|
[8558044] | 301 | <screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
|
---|
[138bdf6] | 302 |
|
---|
| 303 | <note revision="systemd">
|
---|
| 304 | <para>
|
---|
| 305 | Make sure that you disable the <command>systemd-networkd</command>
|
---|
| 306 | service or configure it not to manage the interfaces you want to
|
---|
| 307 | manage with <command>dhclient</command>.
|
---|
| 308 | </para>
|
---|
| 309 | </note>
|
---|
| 310 |
|
---|
[697cb83f] | 311 | <para>
|
---|
| 312 | At this point you can test if <command>dhclient</command> is
|
---|
| 313 | behaving as expected by running the following command as the
|
---|
| 314 | <systemitem class="username">root</systemitem> user:
|
---|
| 315 | </para>
|
---|
[0931098] | 316 |
|
---|
[138bdf6] | 317 | <screen role="root" revision="sysv"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen>
|
---|
[0931098] | 318 |
|
---|
[138bdf6] | 319 | <screen role="root" revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
---|
| 320 |
|
---|
| 321 | <para revision="sysv">
|
---|
[697cb83f] | 322 | Replace <replaceable><eth0></replaceable> with your
|
---|
| 323 | desired interface. If you want more verbose output, add the
|
---|
| 324 | <command>-v</command> parameter to the command above.
|
---|
| 325 | </para>
|
---|
[0931098] | 326 |
|
---|
[138bdf6] | 327 | <para id="dhclient-service" revision="sysv">
|
---|
[697cb83f] | 328 | If you want to configure network interfaces at boot using
|
---|
| 329 | <command>dhclient</command>, you need to install the
|
---|
| 330 | <filename>/lib/services/dhclient</filename> script
|
---|
| 331 | included in <xref linkend="bootscripts"/> package:
|
---|
| 332 | </para>
|
---|
[04a6794] | 333 |
|
---|
[138bdf6] | 334 | <screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
|
---|
[04a6794] | 335 |
|
---|
[138bdf6] | 336 | <indexterm zone="dhcp dhclient-service" revision="sysv">
|
---|
[697cb83f] | 337 | <primary sortas="f-dhclient">dhclient (service script)</primary>
|
---|
[6ad98e12] | 338 | </indexterm>
|
---|
[04a6794] | 339 |
|
---|
[138bdf6] | 340 | <para id="dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 341 | Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
|
---|
| 342 | configuration file with the following commands as the
|
---|
| 343 | <systemitem class="username">root</systemitem> user:
|
---|
| 344 | </para>
|
---|
| 345 |
|
---|
[138bdf6] | 346 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
---|
[697cb83f] | 347 | <literal>ONBOOT="yes"
|
---|
| 348 | IFACE="eth0"
|
---|
| 349 | SERVICE="dhclient"
|
---|
| 350 | DHCP_START=""
|
---|
| 351 | DHCP_STOP=""
|
---|
| 352 |
|
---|
| 353 | # Set PRINTIP="yes" to have the script print
|
---|
| 354 | # the DHCP assigned IP address
|
---|
| 355 | PRINTIP="no"
|
---|
| 356 |
|
---|
| 357 | # Set PRINTALL="yes" to print the DHCP assigned values for
|
---|
| 358 | # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
---|
| 359 | PRINTALL="no"</literal>
|
---|
| 360 | EOF</userinput></screen>
|
---|
| 361 |
|
---|
[138bdf6] | 362 | <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 363 | <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
|
---|
[6ad98e12] | 364 | </indexterm>
|
---|
[0931098] | 365 |
|
---|
[138bdf6] | 366 | <para revision="sysv">
|
---|
[697cb83f] | 367 | Adjust the file to suit your needs.
|
---|
| 368 | </para>
|
---|
[0931098] | 369 |
|
---|
[138bdf6] | 370 | <para revision="sysv">
|
---|
[697cb83f] | 371 | For more information on the appropriate <envar>DHCP_START</envar>
|
---|
| 372 | and <envar>DHCP_STOP</envar> values see
|
---|
| 373 | <command>man 8 dhclient</command>.
|
---|
| 374 | </para>
|
---|
[0931098] | 375 |
|
---|
[138bdf6] | 376 | <para revision="systemd">
|
---|
| 377 | To start <command>dhclient</command> on a specific interface
|
---|
| 378 | at boot, enable the previously installed systemd unit by
|
---|
| 379 | running the following command as the
|
---|
| 380 | <systemitem class="username">root</systemitem> user:
|
---|
| 381 | </para>
|
---|
[0931098] | 382 |
|
---|
[138bdf6] | 383 | <screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
---|
| 384 |
|
---|
| 385 | <para revision="systemd">
|
---|
| 386 | Replace <replaceable>eth0</replaceable> with the actual interface name.
|
---|
| 387 | </para>
|
---|
[3c7bd00] | 388 |
|
---|
| 389 | </sect3>
|
---|
| 390 |
|
---|
[697cb83f] | 391 | <sect3 id="dhcpd-config">
|
---|
| 392 | <title>Server Configuration</title>
|
---|
[4774914f] | 393 |
|
---|
[697cb83f] | 394 | <para>
|
---|
| 395 | Note that you only need the DHCP server if you want to issue
|
---|
| 396 | LAN addresses over your network. The DHCP client doesn't need
|
---|
| 397 | the server in order to function properly.
|
---|
| 398 | </para>
|
---|
[04a6794] | 399 |
|
---|
[697cb83f] | 400 | <para>
|
---|
| 401 | Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
|
---|
| 402 | by running the following command as the
|
---|
| 403 | <systemitem class="username">root</systemitem> user:
|
---|
| 404 | </para>
|
---|
[0931098] | 405 |
|
---|
[697cb83f] | 406 | <screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF"
|
---|
| 407 | <literal># Begin /etc/dhcp/dhcpd.conf
|
---|
| 408 | #
|
---|
| 409 | # Example dhcpd.conf(5)
|
---|
[0931098] | 410 |
|
---|
[9fe7d58] | 411 | # Use this to enable / disable dynamic dns updates globally.
|
---|
[697cb83f] | 412 | ddns-update-style none;
|
---|
[0931098] | 413 |
|
---|
[697cb83f] | 414 | # option definitions common to all supported networks...
|
---|
| 415 | option domain-name "example.org";
|
---|
| 416 | option domain-name-servers ns1.example.org, ns2.example.org;
|
---|
[0931098] | 417 |
|
---|
[697cb83f] | 418 | default-lease-time 600;
|
---|
| 419 | max-lease-time 7200;
|
---|
[6ad98e12] | 420 |
|
---|
[697cb83f] | 421 | # This is a very basic subnet declaration.
|
---|
| 422 | subnet 10.254.239.0 netmask 255.255.255.224 {
|
---|
| 423 | range 10.254.239.10 10.254.239.20;
|
---|
| 424 | option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
---|
| 425 | }
|
---|
[0931098] | 426 |
|
---|
[697cb83f] | 427 | # End /etc/dhcp/dhcpd.conf</literal>
|
---|
[6ad98e12] | 428 | EOF</userinput></screen>
|
---|
| 429 |
|
---|
[697cb83f] | 430 | <para>
|
---|
| 431 | Adjust the file to suit your needs. See
|
---|
| 432 | <command>man 5 dhcpd.conf</command> for additional options.
|
---|
| 433 | </para>
|
---|
| 434 |
|
---|
| 435 | <para>
|
---|
| 436 | Now create the <filename class="directory">/var/lib/dhcpd</filename>
|
---|
| 437 | directory which will contain DHCP Server leases by running the following
|
---|
| 438 | command as the <systemitem class="username">root</systemitem> user:
|
---|
| 439 | </para>
|
---|
| 440 |
|
---|
| 441 | <screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</userinput></screen>
|
---|
| 442 |
|
---|
| 443 | <para>
|
---|
[138bdf6] | 444 | If you want to start the DHCP Server at boot, install the
|
---|
| 445 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/dhcpd</filename>
|
---|
| 446 | inti script</phrase>
|
---|
| 447 | <phrase revision="systemd"><filename>dhcpd.service</filename>
|
---|
| 448 | unit</phrase> included in the
|
---|
[3c7bd00] | 449 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
| 450 | <xref linkend="systemd-units" revision="systemd"/>
|
---|
[697cb83f] | 451 | package:
|
---|
| 452 | </para>
|
---|
| 453 |
|
---|
| 454 | <screen role="root"><userinput>make install-dhcpd</userinput></screen>
|
---|
| 455 |
|
---|
| 456 | <indexterm zone="dhcp dhcpd-config">
|
---|
| 457 | <primary sortas="f-dhcpd">dhcpd</primary>
|
---|
| 458 | </indexterm>
|
---|
| 459 |
|
---|
| 460 | <para>
|
---|
| 461 | You will need to edit the
|
---|
[138bdf6] | 462 | <phrase revision="sysv"><filename>/etc/sysconfig/dhcpd</filename></phrase>
|
---|
| 463 | <phrase revision="systemd"><filename>/etc/default/dhcpd</filename></phrase>
|
---|
| 464 | in order to set the interface on which <command>dhcpd</command>
|
---|
[697cb83f] | 465 | will serve the DHCP requests.
|
---|
| 466 | </para>
|
---|
[6ad98e12] | 467 |
|
---|
| 468 | </sect3>
|
---|
| 469 |
|
---|
| 470 | </sect2>
|
---|
| 471 |
|
---|
| 472 | <sect2 role="content">
|
---|
| 473 | <title>Contents</title>
|
---|
| 474 |
|
---|
| 475 | <segmentedlist>
|
---|
| 476 | <segtitle>Installed Programs</segtitle>
|
---|
| 477 | <segtitle>Installed Libraries</segtitle>
|
---|
| 478 | <segtitle>Installed Directories</segtitle>
|
---|
| 479 |
|
---|
| 480 | <seglistitem>
|
---|
[697cb83f] | 481 | <seg>
|
---|
| 482 | dhclient, dhclient-script, dhcpd, dhcrelay and omshell
|
---|
| 483 | </seg>
|
---|
| 484 | <seg>
|
---|
[f77c63d0] | 485 | libdhcpctl.a and libomapi.a
|
---|
[697cb83f] | 486 | </seg>
|
---|
| 487 | <seg>
|
---|
[03f254d] | 488 | /etc/dhcp,
|
---|
[697cb83f] | 489 | /usr/include/dhcpctl,
|
---|
| 490 | /usr/include/isc-dhcp,
|
---|
| 491 | /usr/include/omapip,
|
---|
| 492 | /var/lib/dhclient and
|
---|
| 493 | /var/lib/dhcpd
|
---|
| 494 | </seg>
|
---|
[6ad98e12] | 495 | </seglistitem>
|
---|
| 496 | </segmentedlist>
|
---|
| 497 |
|
---|
| 498 | <variablelist>
|
---|
| 499 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 500 | <?dbfo list-presentation="list"?>
|
---|
| 501 | <?dbhtml list-presentation="table"?>
|
---|
| 502 |
|
---|
| 503 | <varlistentry id="dhclient">
|
---|
| 504 | <term><command>dhclient</command></term>
|
---|
| 505 | <listitem>
|
---|
[697cb83f] | 506 | <para>
|
---|
[4c24eb0a] | 507 | is the implementation of the DHCP client
|
---|
[697cb83f] | 508 | </para>
|
---|
[6ad98e12] | 509 | <indexterm zone="dhcp dhclient">
|
---|
| 510 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 511 | </indexterm>
|
---|
| 512 | </listitem>
|
---|
| 513 | </varlistentry>
|
---|
| 514 |
|
---|
[fa3e12e1] | 515 | <varlistentry id="dhclient-script">
|
---|
| 516 | <term><command>dhclient-script</command></term>
|
---|
| 517 | <listitem>
|
---|
[697cb83f] | 518 | <para>
|
---|
| 519 | is used by dhclient to (re)configure interfaces. It can make
|
---|
[4c24eb0a] | 520 | extra changes by invoking custom dhclient-{entry,exit}-hooks
|
---|
[697cb83f] | 521 | </para>
|
---|
[fa3e12e1] | 522 | <indexterm zone="dhcp dhclient-script">
|
---|
| 523 | <primary sortas="b-dhclient-script">dhclient-script</primary>
|
---|
| 524 | </indexterm>
|
---|
| 525 | </listitem>
|
---|
| 526 | </varlistentry>
|
---|
| 527 |
|
---|
[6ad98e12] | 528 | <varlistentry id="dhcpd">
|
---|
| 529 | <term><command>dhcpd</command></term>
|
---|
| 530 | <listitem>
|
---|
[697cb83f] | 531 | <para>
|
---|
| 532 | implements Dynamic Host Configuration Protocol (DHCP) and
|
---|
| 533 | Internet Bootstrap Protocol (BOOTP) requests for network
|
---|
[4c24eb0a] | 534 | addresses
|
---|
[697cb83f] | 535 | </para>
|
---|
[6ad98e12] | 536 | <indexterm zone="dhcp dhcpd">
|
---|
| 537 | <primary sortas="b-dhcpd">dhcpd</primary>
|
---|
| 538 | </indexterm>
|
---|
| 539 | </listitem>
|
---|
| 540 | </varlistentry>
|
---|
| 541 |
|
---|
| 542 | <varlistentry id="dhcrelay">
|
---|
| 543 | <term><command>dhcrelay</command></term>
|
---|
| 544 | <listitem>
|
---|
[697cb83f] | 545 | <para>
|
---|
| 546 | provides a means to accept DHCP and BOOTP requests on a subnet
|
---|
| 547 | without a DHCP server and relay them to a DHCP server on another
|
---|
[4c24eb0a] | 548 | subnet
|
---|
[697cb83f] | 549 | </para>
|
---|
[6ad98e12] | 550 | <indexterm zone="dhcp dhcrelay">
|
---|
| 551 | <primary sortas="b-dhcrelay">dhcrelay</primary>
|
---|
| 552 | </indexterm>
|
---|
| 553 | </listitem>
|
---|
| 554 | </varlistentry>
|
---|
| 555 |
|
---|
| 556 | <varlistentry id="omshell">
|
---|
| 557 | <term><command>omshell</command></term>
|
---|
| 558 | <listitem>
|
---|
[697cb83f] | 559 | <para>
|
---|
| 560 | provides an interactive way to connect to, query and
|
---|
| 561 | possibly change the ISC DHCP Server's state via OMAPI, the
|
---|
[4c24eb0a] | 562 | Object Management API
|
---|
[697cb83f] | 563 | </para>
|
---|
[6ad98e12] | 564 | <indexterm zone="dhcp omshell">
|
---|
| 565 | <primary sortas="b-omshell">omshell</primary>
|
---|
| 566 | </indexterm>
|
---|
| 567 | </listitem>
|
---|
| 568 | </varlistentry>
|
---|
| 569 |
|
---|
| 570 | </variablelist>
|
---|
| 571 |
|
---|
| 572 | </sect2>
|
---|
[04a6794] | 573 |
|
---|
[f45b1953] | 574 | </sect1>
|
---|