[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">
|
---|
[7637013] | 9 | <!ENTITY dhcp-md5sum "9076af4cc1293dde5a7c6cae7de6ab45">
|
---|
| 10 | <!ENTITY dhcp-size "9.6 MB">
|
---|
| 11 | <!ENTITY dhcp-buildsize "200 MB">
|
---|
| 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 | <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 |
|
---|
[de22bfa] | 39 | &lfs111_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 |
|
---|
[7a38222] | 129 | <!-- Not needed when building DHCP-4.4.3.
|
---|
[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>
|
---|
[7a38222] | 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 | -->
|
---|
[0e1ef1cc] | 169 | <screen><userinput>( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \
|
---|
[095d076] | 170 | -D_PATH_DHCLIENT_SCRIPT='\"/usr/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 |
|
---|
[095d076] | 195 | <screen role="root"><userinput>make -C client install &&
|
---|
| 196 | install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 197 |
|
---|
[697cb83f] | 198 | <para>
|
---|
[138bdf6] | 199 | Skip to <xref linkend="dhclient-config"/> in order to configure the
|
---|
| 200 | client
|
---|
[697cb83f] | 201 | </para>
|
---|
[6ad98e12] | 202 |
|
---|
[697cb83f] | 203 | <para>
|
---|
| 204 | If you only want to install the <application>ISC DHCP</application> server,
|
---|
| 205 | issue the following command as the
|
---|
| 206 | <systemitem class="username">root</systemitem> user:
|
---|
| 207 | </para>
|
---|
[fa3e12e1] | 208 |
|
---|
[697cb83f] | 209 | <screen role="root"><userinput>make -C server install</userinput></screen>
|
---|
[fa3e12e1] | 210 |
|
---|
[697cb83f] | 211 | <para>
|
---|
| 212 | Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
|
---|
| 213 | </para>
|
---|
[275b1da] | 214 |
|
---|
[697cb83f] | 215 | <para>
|
---|
| 216 | Alternatively, you can install whole package which includes the client,
|
---|
| 217 | server, relay, static libraries and development headers by running the
|
---|
| 218 | following commands as the
|
---|
| 219 | <systemitem class="username">root</systemitem> user:
|
---|
| 220 | </para>
|
---|
[04a6794] | 221 |
|
---|
[095d076] | 222 | <screen role="root"><userinput>make install &&
|
---|
| 223 | install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
---|
[fa3e12e1] | 224 |
|
---|
[697cb83f] | 225 | </sect2>
|
---|
[fa3e12e1] | 226 |
|
---|
[697cb83f] | 227 | <sect2 role="configuration">
|
---|
| 228 | <title>Configuring ISC DHCP</title>
|
---|
[fa3e12e1] | 229 |
|
---|
[697cb83f] | 230 | <sect3 id="dhcp-config">
|
---|
| 231 | <title>Config Files</title>
|
---|
[fa3e12e1] | 232 |
|
---|
[697cb83f] | 233 | <para>
|
---|
| 234 | <filename>/etc/dhcp/dhclient.conf</filename> and
|
---|
| 235 | <filename>/etc/dhcp/dhcpd.conf</filename>
|
---|
| 236 | </para>
|
---|
[0931098] | 237 |
|
---|
[697cb83f] | 238 | <indexterm zone="dhcp dhcp-config">
|
---|
| 239 | <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
|
---|
| 240 | </indexterm>
|
---|
[0931098] | 241 |
|
---|
[697cb83f] | 242 | <indexterm zone="dhcp dhcp-config">
|
---|
| 243 | <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
|
---|
| 244 | </indexterm>
|
---|
[0931098] | 245 |
|
---|
[697cb83f] | 246 | </sect3>
|
---|
[fa3e12e1] | 247 |
|
---|
[138bdf6] | 248 | <sect3 id="dhclient-config">
|
---|
[697cb83f] | 249 | <title>Client Configuration</title>
|
---|
| 250 |
|
---|
| 251 | <para>
|
---|
[f77c63d0] | 252 | Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
|
---|
[697cb83f] | 253 | by running the following command as the
|
---|
| 254 | <systemitem class="username">root</systemitem> user:
|
---|
| 255 | </para>
|
---|
| 256 |
|
---|
[37f4f30] | 257 | <screen role="root"><userinput>install -vdm755 /etc/dhcp &&
|
---|
| 258 | cat > /etc/dhcp/dhclient.conf << "EOF"
|
---|
[697cb83f] | 259 | <literal># Begin /etc/dhcp/dhclient.conf
|
---|
| 260 | #
|
---|
| 261 | # Basic dhclient.conf(5)
|
---|
| 262 |
|
---|
| 263 | #prepend domain-name-servers 127.0.0.1;
|
---|
| 264 | request subnet-mask, broadcast-address, time-offset, routers,
|
---|
| 265 | domain-name, domain-name-servers, domain-search, host-name,
|
---|
| 266 | netbios-name-servers, netbios-scope, interface-mtu,
|
---|
| 267 | ntp-servers;
|
---|
| 268 | require subnet-mask, domain-name-servers;
|
---|
| 269 | #timeout 60;
|
---|
| 270 | #retry 60;
|
---|
| 271 | #reboot 10;
|
---|
| 272 | #select-timeout 5;
|
---|
| 273 | #initial-interval 2;
|
---|
| 274 |
|
---|
| 275 | # End /etc/dhcp/dhclient.conf</literal>
|
---|
| 276 | EOF</userinput></screen>
|
---|
[fa3e12e1] | 277 |
|
---|
[697cb83f] | 278 | <para>
|
---|
| 279 | See <command>man 5 dhclient.conf</command> for additional options.
|
---|
| 280 | </para>
|
---|
[fa3e12e1] | 281 |
|
---|
[697cb83f] | 282 | <para>
|
---|
| 283 | Now create the <filename class="directory">/var/lib/dhclient</filename>
|
---|
| 284 | directory which will contain DHCP Client leases by running the following
|
---|
| 285 | command as the <systemitem class="username">root</systemitem> user:
|
---|
| 286 | </para>
|
---|
[fa3e12e1] | 287 |
|
---|
[697cb83f] | 288 | <screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
|
---|
[fa3e12e1] | 289 |
|
---|
[138bdf6] | 290 | <para id="dhclient-service-sysd" revision="systemd">
|
---|
| 291 | If you want to configure network interfaces at boot using
|
---|
| 292 | <command>dhclient</command>, you need to install the
|
---|
| 293 | <filename>dhclient@.service</filename> unit included in the
|
---|
| 294 | <xref linkend="systemd-units"/> package by running the following
|
---|
| 295 | command as the <systemitem class="username">root</systemitem> user:
|
---|
| 296 | </para>
|
---|
| 297 |
|
---|
| 298 | <indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
|
---|
| 299 | <primary sortas="f-dhclient">dhclient@.service</primary>
|
---|
| 300 | </indexterm>
|
---|
| 301 |
|
---|
[8558044] | 302 | <screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
|
---|
[138bdf6] | 303 |
|
---|
| 304 | <note revision="systemd">
|
---|
| 305 | <para>
|
---|
| 306 | Make sure that you disable the <command>systemd-networkd</command>
|
---|
| 307 | service or configure it not to manage the interfaces you want to
|
---|
| 308 | manage with <command>dhclient</command>.
|
---|
| 309 | </para>
|
---|
| 310 | </note>
|
---|
| 311 |
|
---|
[697cb83f] | 312 | <para>
|
---|
| 313 | At this point you can test if <command>dhclient</command> is
|
---|
| 314 | behaving as expected by running the following command as the
|
---|
| 315 | <systemitem class="username">root</systemitem> user:
|
---|
| 316 | </para>
|
---|
[0931098] | 317 |
|
---|
[1d083343] | 318 | <screen role="root"
|
---|
| 319 | remap="test"
|
---|
| 320 | revision="sysv"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen>
|
---|
[0931098] | 321 |
|
---|
[1d083343] | 322 | <screen role="root"
|
---|
| 323 | remap="test"
|
---|
| 324 | revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
---|
[138bdf6] | 325 |
|
---|
| 326 | <para revision="sysv">
|
---|
[697cb83f] | 327 | Replace <replaceable><eth0></replaceable> with your
|
---|
| 328 | desired interface. If you want more verbose output, add the
|
---|
| 329 | <command>-v</command> parameter to the command above.
|
---|
| 330 | </para>
|
---|
[0931098] | 331 |
|
---|
[138bdf6] | 332 | <para id="dhclient-service" revision="sysv">
|
---|
[697cb83f] | 333 | If you want to configure network interfaces at boot using
|
---|
| 334 | <command>dhclient</command>, you need to install the
|
---|
| 335 | <filename>/lib/services/dhclient</filename> script
|
---|
| 336 | included in <xref linkend="bootscripts"/> package:
|
---|
| 337 | </para>
|
---|
[04a6794] | 338 |
|
---|
[138bdf6] | 339 | <screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
|
---|
[04a6794] | 340 |
|
---|
[138bdf6] | 341 | <indexterm zone="dhcp dhclient-service" revision="sysv">
|
---|
[697cb83f] | 342 | <primary sortas="f-dhclient">dhclient (service script)</primary>
|
---|
[6ad98e12] | 343 | </indexterm>
|
---|
[04a6794] | 344 |
|
---|
[138bdf6] | 345 | <para id="dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 346 | Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
|
---|
| 347 | configuration file with the following commands as the
|
---|
| 348 | <systemitem class="username">root</systemitem> user:
|
---|
| 349 | </para>
|
---|
| 350 |
|
---|
[138bdf6] | 351 | <screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
---|
[697cb83f] | 352 | <literal>ONBOOT="yes"
|
---|
| 353 | IFACE="eth0"
|
---|
| 354 | SERVICE="dhclient"
|
---|
| 355 | DHCP_START=""
|
---|
| 356 | DHCP_STOP=""
|
---|
| 357 |
|
---|
| 358 | # Set PRINTIP="yes" to have the script print
|
---|
| 359 | # the DHCP assigned IP address
|
---|
| 360 | PRINTIP="no"
|
---|
| 361 |
|
---|
| 362 | # Set PRINTALL="yes" to print the DHCP assigned values for
|
---|
| 363 | # IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
---|
| 364 | PRINTALL="no"</literal>
|
---|
| 365 | EOF</userinput></screen>
|
---|
| 366 |
|
---|
[138bdf6] | 367 | <indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
|
---|
[697cb83f] | 368 | <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
|
---|
[6ad98e12] | 369 | </indexterm>
|
---|
[0931098] | 370 |
|
---|
[138bdf6] | 371 | <para revision="sysv">
|
---|
[697cb83f] | 372 | Adjust the file to suit your needs.
|
---|
| 373 | </para>
|
---|
[0931098] | 374 |
|
---|
[138bdf6] | 375 | <para revision="sysv">
|
---|
[697cb83f] | 376 | For more information on the appropriate <envar>DHCP_START</envar>
|
---|
| 377 | and <envar>DHCP_STOP</envar> values see
|
---|
| 378 | <command>man 8 dhclient</command>.
|
---|
| 379 | </para>
|
---|
[0931098] | 380 |
|
---|
[138bdf6] | 381 | <para revision="systemd">
|
---|
| 382 | To start <command>dhclient</command> on a specific interface
|
---|
| 383 | at boot, enable the previously installed systemd unit by
|
---|
| 384 | running the following command as the
|
---|
| 385 | <systemitem class="username">root</systemitem> user:
|
---|
| 386 | </para>
|
---|
[0931098] | 387 |
|
---|
[138bdf6] | 388 | <screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
---|
| 389 |
|
---|
| 390 | <para revision="systemd">
|
---|
| 391 | Replace <replaceable>eth0</replaceable> with the actual interface name.
|
---|
| 392 | </para>
|
---|
[3c7bd00] | 393 |
|
---|
| 394 | </sect3>
|
---|
| 395 |
|
---|
[697cb83f] | 396 | <sect3 id="dhcpd-config">
|
---|
| 397 | <title>Server Configuration</title>
|
---|
[4774914f] | 398 |
|
---|
[697cb83f] | 399 | <para>
|
---|
| 400 | Note that you only need the DHCP server if you want to issue
|
---|
| 401 | LAN addresses over your network. The DHCP client doesn't need
|
---|
| 402 | the server in order to function properly.
|
---|
| 403 | </para>
|
---|
[04a6794] | 404 |
|
---|
[697cb83f] | 405 | <para>
|
---|
| 406 | Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
|
---|
| 407 | by running the following command as the
|
---|
| 408 | <systemitem class="username">root</systemitem> user:
|
---|
| 409 | </para>
|
---|
[0931098] | 410 |
|
---|
[697cb83f] | 411 | <screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF"
|
---|
| 412 | <literal># Begin /etc/dhcp/dhcpd.conf
|
---|
| 413 | #
|
---|
| 414 | # Example dhcpd.conf(5)
|
---|
[0931098] | 415 |
|
---|
[9fe7d58] | 416 | # Use this to enable / disable dynamic dns updates globally.
|
---|
[697cb83f] | 417 | ddns-update-style none;
|
---|
[0931098] | 418 |
|
---|
[697cb83f] | 419 | # option definitions common to all supported networks...
|
---|
| 420 | option domain-name "example.org";
|
---|
| 421 | option domain-name-servers ns1.example.org, ns2.example.org;
|
---|
[0931098] | 422 |
|
---|
[697cb83f] | 423 | default-lease-time 600;
|
---|
| 424 | max-lease-time 7200;
|
---|
[6ad98e12] | 425 |
|
---|
[697cb83f] | 426 | # This is a very basic subnet declaration.
|
---|
| 427 | subnet 10.254.239.0 netmask 255.255.255.224 {
|
---|
| 428 | range 10.254.239.10 10.254.239.20;
|
---|
| 429 | option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
---|
| 430 | }
|
---|
[0931098] | 431 |
|
---|
[697cb83f] | 432 | # End /etc/dhcp/dhcpd.conf</literal>
|
---|
[6ad98e12] | 433 | EOF</userinput></screen>
|
---|
| 434 |
|
---|
[697cb83f] | 435 | <para>
|
---|
| 436 | Adjust the file to suit your needs. See
|
---|
| 437 | <command>man 5 dhcpd.conf</command> for additional options.
|
---|
| 438 | </para>
|
---|
| 439 |
|
---|
[db19db1] | 440 | <!-- the "touch..." is needed according to dhcpd.leases(5) -->
|
---|
[697cb83f] | 441 | <para>
|
---|
[db19db1] | 442 | Now create the <filename>/var/lib/dhcpd/dhcpd.leases</filename>
|
---|
[697cb83f] | 443 | directory which will contain DHCP Server leases by running the following
|
---|
[db19db1] | 444 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
[697cb83f] | 445 | </para>
|
---|
| 446 |
|
---|
[db19db1] | 447 | <screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd &&
|
---|
| 448 | touch /var/lib/dhcpd/dhcpd.leases</userinput></screen>
|
---|
[697cb83f] | 449 |
|
---|
| 450 | <para>
|
---|
[138bdf6] | 451 | If you want to start the DHCP Server at boot, install the
|
---|
| 452 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/dhcpd</filename>
|
---|
| 453 | inti script</phrase>
|
---|
| 454 | <phrase revision="systemd"><filename>dhcpd.service</filename>
|
---|
| 455 | unit</phrase> included in the
|
---|
[3c7bd00] | 456 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
| 457 | <xref linkend="systemd-units" revision="systemd"/>
|
---|
[697cb83f] | 458 | package:
|
---|
| 459 | </para>
|
---|
| 460 |
|
---|
| 461 | <screen role="root"><userinput>make install-dhcpd</userinput></screen>
|
---|
| 462 |
|
---|
| 463 | <indexterm zone="dhcp dhcpd-config">
|
---|
| 464 | <primary sortas="f-dhcpd">dhcpd</primary>
|
---|
| 465 | </indexterm>
|
---|
| 466 |
|
---|
| 467 | <para>
|
---|
| 468 | You will need to edit the
|
---|
[138bdf6] | 469 | <phrase revision="sysv"><filename>/etc/sysconfig/dhcpd</filename></phrase>
|
---|
| 470 | <phrase revision="systemd"><filename>/etc/default/dhcpd</filename></phrase>
|
---|
| 471 | in order to set the interface on which <command>dhcpd</command>
|
---|
[697cb83f] | 472 | will serve the DHCP requests.
|
---|
| 473 | </para>
|
---|
[6ad98e12] | 474 |
|
---|
| 475 | </sect3>
|
---|
| 476 |
|
---|
| 477 | </sect2>
|
---|
| 478 |
|
---|
| 479 | <sect2 role="content">
|
---|
| 480 | <title>Contents</title>
|
---|
| 481 |
|
---|
| 482 | <segmentedlist>
|
---|
| 483 | <segtitle>Installed Programs</segtitle>
|
---|
| 484 | <segtitle>Installed Libraries</segtitle>
|
---|
| 485 | <segtitle>Installed Directories</segtitle>
|
---|
| 486 |
|
---|
| 487 | <seglistitem>
|
---|
[697cb83f] | 488 | <seg>
|
---|
| 489 | dhclient, dhclient-script, dhcpd, dhcrelay and omshell
|
---|
| 490 | </seg>
|
---|
| 491 | <seg>
|
---|
[f77c63d0] | 492 | libdhcpctl.a and libomapi.a
|
---|
[697cb83f] | 493 | </seg>
|
---|
| 494 | <seg>
|
---|
[03f254d] | 495 | /etc/dhcp,
|
---|
[697cb83f] | 496 | /usr/include/dhcpctl,
|
---|
| 497 | /usr/include/isc-dhcp,
|
---|
| 498 | /usr/include/omapip,
|
---|
| 499 | /var/lib/dhclient and
|
---|
| 500 | /var/lib/dhcpd
|
---|
| 501 | </seg>
|
---|
[6ad98e12] | 502 | </seglistitem>
|
---|
| 503 | </segmentedlist>
|
---|
| 504 |
|
---|
| 505 | <variablelist>
|
---|
| 506 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 507 | <?dbfo list-presentation="list"?>
|
---|
| 508 | <?dbhtml list-presentation="table"?>
|
---|
| 509 |
|
---|
| 510 | <varlistentry id="dhclient">
|
---|
| 511 | <term><command>dhclient</command></term>
|
---|
| 512 | <listitem>
|
---|
[697cb83f] | 513 | <para>
|
---|
[4c24eb0a] | 514 | is the implementation of the DHCP client
|
---|
[697cb83f] | 515 | </para>
|
---|
[6ad98e12] | 516 | <indexterm zone="dhcp dhclient">
|
---|
| 517 | <primary sortas="b-dhclient">dhclient</primary>
|
---|
| 518 | </indexterm>
|
---|
| 519 | </listitem>
|
---|
| 520 | </varlistentry>
|
---|
| 521 |
|
---|
[fa3e12e1] | 522 | <varlistentry id="dhclient-script">
|
---|
| 523 | <term><command>dhclient-script</command></term>
|
---|
| 524 | <listitem>
|
---|
[697cb83f] | 525 | <para>
|
---|
| 526 | is used by dhclient to (re)configure interfaces. It can make
|
---|
[4c24eb0a] | 527 | extra changes by invoking custom dhclient-{entry,exit}-hooks
|
---|
[697cb83f] | 528 | </para>
|
---|
[fa3e12e1] | 529 | <indexterm zone="dhcp dhclient-script">
|
---|
| 530 | <primary sortas="b-dhclient-script">dhclient-script</primary>
|
---|
| 531 | </indexterm>
|
---|
| 532 | </listitem>
|
---|
| 533 | </varlistentry>
|
---|
| 534 |
|
---|
[6ad98e12] | 535 | <varlistentry id="dhcpd">
|
---|
| 536 | <term><command>dhcpd</command></term>
|
---|
| 537 | <listitem>
|
---|
[697cb83f] | 538 | <para>
|
---|
| 539 | implements Dynamic Host Configuration Protocol (DHCP) and
|
---|
| 540 | Internet Bootstrap Protocol (BOOTP) requests for network
|
---|
[4c24eb0a] | 541 | addresses
|
---|
[697cb83f] | 542 | </para>
|
---|
[6ad98e12] | 543 | <indexterm zone="dhcp dhcpd">
|
---|
| 544 | <primary sortas="b-dhcpd">dhcpd</primary>
|
---|
| 545 | </indexterm>
|
---|
| 546 | </listitem>
|
---|
| 547 | </varlistentry>
|
---|
| 548 |
|
---|
| 549 | <varlistentry id="dhcrelay">
|
---|
| 550 | <term><command>dhcrelay</command></term>
|
---|
| 551 | <listitem>
|
---|
[697cb83f] | 552 | <para>
|
---|
| 553 | provides a means to accept DHCP and BOOTP requests on a subnet
|
---|
| 554 | without a DHCP server and relay them to a DHCP server on another
|
---|
[4c24eb0a] | 555 | subnet
|
---|
[697cb83f] | 556 | </para>
|
---|
[6ad98e12] | 557 | <indexterm zone="dhcp dhcrelay">
|
---|
| 558 | <primary sortas="b-dhcrelay">dhcrelay</primary>
|
---|
| 559 | </indexterm>
|
---|
| 560 | </listitem>
|
---|
| 561 | </varlistentry>
|
---|
| 562 |
|
---|
| 563 | <varlistentry id="omshell">
|
---|
| 564 | <term><command>omshell</command></term>
|
---|
| 565 | <listitem>
|
---|
[697cb83f] | 566 | <para>
|
---|
| 567 | provides an interactive way to connect to, query and
|
---|
| 568 | possibly change the ISC DHCP Server's state via OMAPI, the
|
---|
[4c24eb0a] | 569 | Object Management API
|
---|
[697cb83f] | 570 | </para>
|
---|
[6ad98e12] | 571 | <indexterm zone="dhcp omshell">
|
---|
| 572 | <primary sortas="b-omshell">omshell</primary>
|
---|
| 573 | </indexterm>
|
---|
| 574 | </listitem>
|
---|
| 575 | </varlistentry>
|
---|
| 576 |
|
---|
| 577 | </variablelist>
|
---|
| 578 |
|
---|
| 579 | </sect2>
|
---|
[04a6794] | 580 |
|
---|
[f45b1953] | 581 | </sect1>
|
---|