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