2004-06-13 13:38:30 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-04-05 03:42:53 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-06-13 13:38:30 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
2012-08-15 06:00:47 +08:00
|
|
|
|
2021-05-27 13:25:26 +08:00
|
|
|
<!ENTITY dhcp-download-http "https://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
2012-08-15 06:00:47 +08:00
|
|
|
<!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
2021-05-28 01:04:50 +08:00
|
|
|
<!ENTITY dhcp-md5sum "3089a1ebd20a802ec0870ae337d43907">
|
2020-01-26 09:41:49 +08:00
|
|
|
<!ENTITY dhcp-size "9.4 MB">
|
|
|
|
<!ENTITY dhcp-buildsize "115 MB">
|
|
|
|
<!ENTITY dhcp-time "0.4 SBU">
|
2004-06-13 13:38:30 +08:00
|
|
|
]>
|
|
|
|
|
2003-09-24 09:20:44 +08:00
|
|
|
<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
|
2005-05-19 03:16:15 +08:00
|
|
|
<?dbhtml filename="dhcp.html"?>
|
|
|
|
|
|
|
|
<sect1info>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
|
|
|
|
|
|
|
<title>DHCP-&dhcp-version;</title>
|
|
|
|
|
|
|
|
<indexterm zone="dhcp">
|
2012-08-15 06:00:47 +08:00
|
|
|
<primary sortas="a-DHCP">DHCP</primary>
|
2005-05-19 03:16:15 +08:00
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
2012-08-15 06:00:47 +08:00
|
|
|
<title>Introduction to ISC DHCP</title>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2016-06-09 13:34:10 +08:00
|
|
|
The <application>ISC DHCP</application> package contains both the client
|
|
|
|
and server programs for DHCP. <command>dhclient</command> (the client) is
|
2012-08-15 06:00:47 +08:00
|
|
|
used for connecting to a network which uses DHCP to assign network
|
|
|
|
addresses. <command>dhcpd</command> (the server) is used for assigning
|
|
|
|
network addresses on private networks.
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2021-02-27 02:39:02 +08:00
|
|
|
&lfs101_checked;
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2005-05-19 03:16:15 +08:00
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Download (HTTP): <ulink url="&dhcp-download-http;"/>
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Download (FTP): <ulink url="&dhcp-download-ftp;"/>
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Download MD5 sum: &dhcp-md5sum;
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Download size: &dhcp-size;
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Estimated disk space required: &dhcp-buildsize;
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Estimated build time: &dhcp-time;
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2017-08-07 03:49:36 +08:00
|
|
|
<!--
|
2005-06-20 15:08:15 +08:00
|
|
|
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
2012-08-15 06:00:47 +08:00
|
|
|
<itemizedlist spacing="compact">
|
2007-01-15 02:38:06 +08:00
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2013-09-06 01:04:34 +08:00
|
|
|
Required patch:
|
2014-08-20 01:00:15 +08:00
|
|
|
<ulink url="&patch-root;/dhcp-&dhcp-version;-client_script-1.patch"/>
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2007-01-15 02:38:06 +08:00
|
|
|
</listitem>
|
2005-06-20 15:08:15 +08:00
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2013-09-06 01:04:34 +08:00
|
|
|
Optional patch:
|
2012-08-15 06:00:47 +08:00
|
|
|
<ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
|
|
|
|
</para>
|
2005-06-20 15:08:15 +08:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2017-08-07 03:49:36 +08:00
|
|
|
-->
|
2006-04-11 02:38:56 +08:00
|
|
|
<para condition="html" role="usernotes">User Notes:
|
2012-08-15 06:00:47 +08:00
|
|
|
<ulink url="&blfs-wiki;/dhcp"/>
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
</sect2>
|
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<sect2 role="kernel" id="dhcp-kernel">
|
2005-05-19 03:16:15 +08:00
|
|
|
<title>Kernel Configuration</title>
|
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2019-07-29 04:39:28 +08:00
|
|
|
You must have Packet Socket support. IPv6 support is optional.
|
2014-12-04 05:46:32 +08:00
|
|
|
</para>
|
|
|
|
|
2019-07-29 04:39:28 +08:00
|
|
|
<screen><literal>[*] Networking support ---> [CONFIG_NET]
|
2014-12-04 05:46:32 +08:00
|
|
|
Networking options --->
|
2019-07-29 04:39:28 +08:00
|
|
|
<*> Packet socket [CONFIG_PACKET]
|
|
|
|
<*> The IPv6 Protocol ---> [CONFIG_IPV6]</literal></screen>
|
|
|
|
<!--
|
2014-12-04 05:46:32 +08:00
|
|
|
<para>
|
|
|
|
If you do not have IPv6 support:
|
|
|
|
</para>
|
|
|
|
|
2019-07-29 04:39:28 +08:00
|
|
|
<screen><literal>[*] Networking support - - -> [CONFIG_NET]
|
|
|
|
Networking Options - - ->
|
|
|
|
<*> The IPv6 Protocol - - -> [CONFIG_IPV6]</literal></screen>
|
2014-12-04 05:46:32 +08:00
|
|
|
|
|
|
|
<para>
|
|
|
|
compiled in, then you must use the <quote>missing_ipv6</quote> patch.
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2019-07-29 04:39:28 +08:00
|
|
|
-->
|
2005-05-19 03:16:15 +08:00
|
|
|
<indexterm zone="dhcp dhcp-kernel">
|
2012-08-15 06:00:47 +08:00
|
|
|
<primary sortas="d-DHCP">DHCP</primary>
|
2005-05-19 03:16:15 +08:00
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
2012-08-15 06:00:47 +08:00
|
|
|
<title>Installation of ISC DHCP</title>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2020-05-14 23:08:11 +08:00
|
|
|
<para>
|
|
|
|
First, fix a build issue with GCC 10 and later:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<screen><userinput>sed -i '/o.*dhcp_type/d' server/mdb.c &&
|
|
|
|
sed -r '/u.*(local|remote)_port/d' \
|
|
|
|
-i client/dhclient.c \
|
|
|
|
relay/dhcrelay.c</userinput></screen>
|
|
|
|
|
2015-09-12 07:20:24 +08:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
This package does not support parallel build.
|
|
|
|
</para>
|
|
|
|
</note>
|
2017-08-07 03:49:36 +08:00
|
|
|
<!-- This should not be needed any more. Visual check appears to handle it.
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
If you have not compiled IPv6 support into the kernel, apply the
|
|
|
|
missing_ipv6 patch:
|
|
|
|
</para>
|
2007-01-15 02:38:06 +08:00
|
|
|
|
2011-12-01 13:09:32 +08:00
|
|
|
<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
2017-08-07 03:49:36 +08:00
|
|
|
-->
|
2012-10-01 14:38:34 +08:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
Be careful with the instructions below. The single and
|
2015-02-23 07:35:15 +08:00
|
|
|
double quotes are important because the defined
|
2012-10-01 14:38:34 +08:00
|
|
|
variables are used verbatim in the code.
|
|
|
|
</para>
|
|
|
|
</note>
|
2012-10-01 09:41:03 +08:00
|
|
|
|
2012-10-01 14:38:34 +08:00
|
|
|
<para>
|
|
|
|
Install <application>ISC DHCP</application> by running
|
|
|
|
the following commands:
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2018-10-04 04:52:55 +08:00
|
|
|
<!--
|
|
|
|
Running ( export CFLAGS=... ./configure ... ) in a subshell
|
|
|
|
preserves CFLAGS if they are set in environment
|
|
|
|
-->
|
2021-02-09 23:25:10 +08:00
|
|
|
<screen><userinput>( export CFLAGS="${CFLAGS:--g -O2} -Wall -fno-strict-aliasing \
|
2021-05-18 00:12:58 +08:00
|
|
|
-D_PATH_DHCLIENT_SCRIPT='\"/usr/sbin/dhclient-script\"' \
|
2012-08-15 06:00:47 +08:00
|
|
|
-D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
|
2016-10-11 08:15:44 +08:00
|
|
|
-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" &&
|
2017-08-07 03:49:36 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
./configure --prefix=/usr \
|
|
|
|
--sysconfdir=/etc/dhcp \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
|
|
|
|
--with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
|
|
|
|
--with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
|
2018-10-04 04:52:55 +08:00
|
|
|
--with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
|
|
|
|
) &&
|
2015-09-12 07:20:24 +08:00
|
|
|
make -j1</userinput></screen>
|
2012-08-15 06:00:47 +08:00
|
|
|
|
|
|
|
<para>
|
2017-08-07 03:49:36 +08:00
|
|
|
<!-- Note: make check builds a library, but otherwise does nothing. -->
|
2016-04-05 03:22:43 +08:00
|
|
|
This package does not come with a test suite.
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you only want to install the <application>ISC DHCP</application> client,
|
|
|
|
issue the following commands as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
2021-05-18 00:12:58 +08:00
|
|
|
<screen role="root"><userinput>make -C client install &&
|
|
|
|
install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2016-06-09 13:34:10 +08:00
|
|
|
Skip to <xref linkend="dhclient-config"/> in order to configure the
|
|
|
|
client
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
If you only want to install the <application>ISC DHCP</application> server,
|
|
|
|
issue the following command as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<screen role="root"><userinput>make -C server install</userinput></screen>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
|
|
|
|
</para>
|
2008-04-12 02:53:54 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Alternatively, you can install whole package which includes the client,
|
|
|
|
server, relay, static libraries and development headers by running the
|
|
|
|
following commands as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2021-05-18 00:12:58 +08:00
|
|
|
<screen role="root"><userinput>make install &&
|
|
|
|
install -v -m755 client/scripts/linux /usr/sbin/dhclient-script</userinput></screen>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
</sect2>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring ISC DHCP</title>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<sect3 id="dhcp-config">
|
|
|
|
<title>Config Files</title>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
<filename>/etc/dhcp/dhclient.conf</filename> and
|
|
|
|
<filename>/etc/dhcp/dhcpd.conf</filename>
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<indexterm zone="dhcp dhcp-config">
|
|
|
|
<primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
|
|
|
|
</indexterm>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<indexterm zone="dhcp dhcp-config">
|
|
|
|
<primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
|
|
|
|
</indexterm>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
</sect3>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<sect3 id="dhclient-config">
|
2012-08-15 06:00:47 +08:00
|
|
|
<title>Client Configuration</title>
|
|
|
|
|
|
|
|
<para>
|
2016-10-11 08:15:44 +08:00
|
|
|
Create a basic <filename>/etc/dhcp/dhclient.conf</filename>
|
2012-08-15 06:00:47 +08:00
|
|
|
by running the following command as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
2016-11-03 10:40:19 +08:00
|
|
|
<screen role="root"><userinput>install -vdm755 /etc/dhcp &&
|
|
|
|
cat > /etc/dhcp/dhclient.conf << "EOF"
|
2012-08-15 06:00:47 +08:00
|
|
|
<literal># Begin /etc/dhcp/dhclient.conf
|
|
|
|
#
|
|
|
|
# Basic dhclient.conf(5)
|
|
|
|
|
|
|
|
#prepend domain-name-servers 127.0.0.1;
|
|
|
|
request subnet-mask, broadcast-address, time-offset, routers,
|
|
|
|
domain-name, domain-name-servers, domain-search, host-name,
|
|
|
|
netbios-name-servers, netbios-scope, interface-mtu,
|
|
|
|
ntp-servers;
|
|
|
|
require subnet-mask, domain-name-servers;
|
|
|
|
#timeout 60;
|
|
|
|
#retry 60;
|
|
|
|
#reboot 10;
|
|
|
|
#select-timeout 5;
|
|
|
|
#initial-interval 2;
|
|
|
|
|
|
|
|
# End /etc/dhcp/dhclient.conf</literal>
|
|
|
|
EOF</userinput></screen>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
See <command>man 5 dhclient.conf</command> for additional options.
|
|
|
|
</para>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Now create the <filename class="directory">/var/lib/dhclient</filename>
|
|
|
|
directory which will contain DHCP Client leases by running the following
|
|
|
|
command as the <systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
|
2011-12-01 13:09:32 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para id="dhclient-service-sysd" revision="systemd">
|
|
|
|
If you want to configure network interfaces at boot using
|
|
|
|
<command>dhclient</command>, you need to install the
|
|
|
|
<filename>dhclient@.service</filename> unit included in the
|
|
|
|
<xref linkend="systemd-units"/> package by running the following
|
|
|
|
command as the <systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<indexterm zone="dhcp dhclient-service-sysd" revision="systemd">
|
|
|
|
<primary sortas="f-dhclient">dhclient@.service</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<screen role="root" revision="systemd"><userinput>make install-dhclient</userinput></screen>
|
|
|
|
|
|
|
|
<note revision="systemd">
|
|
|
|
<para>
|
|
|
|
Make sure that you disable the <command>systemd-networkd</command>
|
|
|
|
service or configure it not to manage the interfaces you want to
|
|
|
|
manage with <command>dhclient</command>.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
At this point you can test if <command>dhclient</command> is
|
|
|
|
behaving as expected by running the following command as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<screen role="root" revision="sysv"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<screen role="root" revision="systemd"><userinput>systemctl start dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
|
|
|
|
|
|
|
<para revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
Replace <replaceable><eth0></replaceable> with your
|
|
|
|
desired interface. If you want more verbose output, add the
|
|
|
|
<command>-v</command> parameter to the command above.
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para id="dhclient-service" revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
If you want to configure network interfaces at boot using
|
|
|
|
<command>dhclient</command>, you need to install the
|
|
|
|
<filename>/lib/services/dhclient</filename> script
|
|
|
|
included in <xref linkend="bootscripts"/> package:
|
|
|
|
</para>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<screen role="root" revision="sysv"><userinput>make install-service-dhclient</userinput></screen>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<indexterm zone="dhcp dhclient-service" revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
<primary sortas="f-dhclient">dhclient (service script)</primary>
|
2005-05-19 03:16:15 +08:00
|
|
|
</indexterm>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para id="dhclient-ifconfig" revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
|
|
|
|
configuration file with the following commands as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<screen role="root" revision="sysv"><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
2012-08-15 06:00:47 +08:00
|
|
|
<literal>ONBOOT="yes"
|
|
|
|
IFACE="eth0"
|
|
|
|
SERVICE="dhclient"
|
|
|
|
DHCP_START=""
|
|
|
|
DHCP_STOP=""
|
|
|
|
|
|
|
|
# Set PRINTIP="yes" to have the script print
|
|
|
|
# the DHCP assigned IP address
|
|
|
|
PRINTIP="no"
|
|
|
|
|
|
|
|
# Set PRINTALL="yes" to print the DHCP assigned values for
|
|
|
|
# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
|
|
|
PRINTALL="no"</literal>
|
|
|
|
EOF</userinput></screen>
|
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<indexterm zone="dhcp dhclient-ifconfig" revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
<primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
|
2005-05-19 03:16:15 +08:00
|
|
|
</indexterm>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
Adjust the file to suit your needs.
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para revision="sysv">
|
2012-08-15 06:00:47 +08:00
|
|
|
For more information on the appropriate <envar>DHCP_START</envar>
|
|
|
|
and <envar>DHCP_STOP</envar> values see
|
|
|
|
<command>man 8 dhclient</command>.
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<para revision="systemd">
|
|
|
|
To start <command>dhclient</command> on a specific interface
|
|
|
|
at boot, enable the previously installed systemd unit by
|
|
|
|
running the following command as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2016-06-09 13:34:10 +08:00
|
|
|
<screen role="root" revision="systemd"><userinput>systemctl enable dhclient@<replaceable>eth0</replaceable></userinput></screen>
|
|
|
|
|
|
|
|
<para revision="systemd">
|
|
|
|
Replace <replaceable>eth0</replaceable> with the actual interface name.
|
|
|
|
</para>
|
2016-06-04 08:20:40 +08:00
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<sect3 id="dhcpd-config">
|
|
|
|
<title>Server Configuration</title>
|
2005-01-01 22:49:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Note that you only need the DHCP server if you want to issue
|
|
|
|
LAN addresses over your network. The DHCP client doesn't need
|
|
|
|
the server in order to function properly.
|
|
|
|
</para>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
|
|
|
|
by running the following command as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF"
|
|
|
|
<literal># Begin /etc/dhcp/dhcpd.conf
|
|
|
|
#
|
|
|
|
# Example dhcpd.conf(5)
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2019-04-22 05:22:52 +08:00
|
|
|
# Use this to enable / disable dynamic dns updates globally.
|
2012-08-15 06:00:47 +08:00
|
|
|
ddns-update-style none;
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
# option definitions common to all supported networks...
|
|
|
|
option domain-name "example.org";
|
|
|
|
option domain-name-servers ns1.example.org, ns2.example.org;
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
default-lease-time 600;
|
|
|
|
max-lease-time 7200;
|
2005-05-19 03:16:15 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
# This is a very basic subnet declaration.
|
|
|
|
subnet 10.254.239.0 netmask 255.255.255.224 {
|
|
|
|
range 10.254.239.10 10.254.239.20;
|
|
|
|
option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
|
|
|
}
|
2004-06-13 13:38:30 +08:00
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
# End /etc/dhcp/dhcpd.conf</literal>
|
2005-05-19 03:16:15 +08:00
|
|
|
EOF</userinput></screen>
|
|
|
|
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
Adjust the file to suit your needs. See
|
|
|
|
<command>man 5 dhcpd.conf</command> for additional options.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Now create the <filename class="directory">/var/lib/dhcpd</filename>
|
|
|
|
directory which will contain DHCP Server leases by running the following
|
|
|
|
command as the <systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</userinput></screen>
|
|
|
|
|
|
|
|
<para>
|
2016-06-09 13:34:10 +08:00
|
|
|
If you want to start the DHCP Server at boot, install the
|
|
|
|
<phrase revision="sysv"><filename>/etc/rc.d/init.d/dhcpd</filename>
|
|
|
|
inti script</phrase>
|
|
|
|
<phrase revision="systemd"><filename>dhcpd.service</filename>
|
|
|
|
unit</phrase> included in the
|
2016-06-04 08:20:40 +08:00
|
|
|
<xref linkend="bootscripts" revision="sysv"/>
|
|
|
|
<xref linkend="systemd-units" revision="systemd"/>
|
2012-08-15 06:00:47 +08:00
|
|
|
package:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<screen role="root"><userinput>make install-dhcpd</userinput></screen>
|
|
|
|
|
|
|
|
<indexterm zone="dhcp dhcpd-config">
|
|
|
|
<primary sortas="f-dhcpd">dhcpd</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
You will need to edit the
|
2016-06-09 13:34:10 +08:00
|
|
|
<phrase revision="sysv"><filename>/etc/sysconfig/dhcpd</filename></phrase>
|
|
|
|
<phrase revision="systemd"><filename>/etc/default/dhcpd</filename></phrase>
|
|
|
|
in order to set the interface on which <command>dhcpd</command>
|
2012-08-15 06:00:47 +08:00
|
|
|
will serve the DHCP requests.
|
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="content">
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Programs</segtitle>
|
|
|
|
<segtitle>Installed Libraries</segtitle>
|
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<seg>
|
|
|
|
dhclient, dhclient-script, dhcpd, dhcrelay and omshell
|
|
|
|
</seg>
|
|
|
|
<seg>
|
2016-10-11 08:15:44 +08:00
|
|
|
libdhcpctl.a and libomapi.a
|
2012-08-15 06:00:47 +08:00
|
|
|
</seg>
|
|
|
|
<seg>
|
2014-02-05 20:42:32 +08:00
|
|
|
/etc/dhcp,
|
2012-08-15 06:00:47 +08:00
|
|
|
/usr/include/dhcpctl,
|
|
|
|
/usr/include/isc-dhcp,
|
|
|
|
/usr/include/omapip,
|
|
|
|
/var/lib/dhclient and
|
|
|
|
/var/lib/dhcpd
|
|
|
|
</seg>
|
2005-05-19 03:16:15 +08:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
|
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
|
|
|
|
<varlistentry id="dhclient">
|
|
|
|
<term><command>dhclient</command></term>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
2021-02-19 23:20:16 +08:00
|
|
|
is the implementation of the DHCP client
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
<indexterm zone="dhcp dhclient">
|
|
|
|
<primary sortas="b-dhclient">dhclient</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2011-12-01 13:09:32 +08:00
|
|
|
<varlistentry id="dhclient-script">
|
|
|
|
<term><command>dhclient-script</command></term>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
is used by dhclient to (re)configure interfaces. It can make
|
2021-02-19 23:20:16 +08:00
|
|
|
extra changes by invoking custom dhclient-{entry,exit}-hooks
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2011-12-01 13:09:32 +08:00
|
|
|
<indexterm zone="dhcp dhclient-script">
|
|
|
|
<primary sortas="b-dhclient-script">dhclient-script</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-05-19 03:16:15 +08:00
|
|
|
<varlistentry id="dhcpd">
|
|
|
|
<term><command>dhcpd</command></term>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
implements Dynamic Host Configuration Protocol (DHCP) and
|
|
|
|
Internet Bootstrap Protocol (BOOTP) requests for network
|
2021-02-19 23:20:16 +08:00
|
|
|
addresses
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
<indexterm zone="dhcp dhcpd">
|
|
|
|
<primary sortas="b-dhcpd">dhcpd</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="dhcrelay">
|
|
|
|
<term><command>dhcrelay</command></term>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
provides a means to accept DHCP and BOOTP requests on a subnet
|
|
|
|
without a DHCP server and relay them to a DHCP server on another
|
2021-02-19 23:20:16 +08:00
|
|
|
subnet
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
<indexterm zone="dhcp dhcrelay">
|
|
|
|
<primary sortas="b-dhcrelay">dhcrelay</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="omshell">
|
|
|
|
<term><command>omshell</command></term>
|
|
|
|
<listitem>
|
2012-08-15 06:00:47 +08:00
|
|
|
<para>
|
|
|
|
provides an interactive way to connect to, query and
|
|
|
|
possibly change the ISC DHCP Server's state via OMAPI, the
|
2021-02-19 23:20:16 +08:00
|
|
|
Object Management API
|
2012-08-15 06:00:47 +08:00
|
|
|
</para>
|
2005-05-19 03:16:15 +08:00
|
|
|
<indexterm zone="dhcp omshell">
|
|
|
|
<primary sortas="b-omshell">omshell</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</sect2>
|
2005-03-07 15:43:33 +08:00
|
|
|
|
2002-07-08 04:28:42 +08:00
|
|
|
</sect1>
|