Repository :
http://git.fedorahosted.org/cgit/docs/networking-guide.git
On branch : master
---------------------------------------------------------------
commit 5e54f4a32b9efc7e7fd12f1b0719ffed4705df67
Author: Stephen Wadeley <swadeley(a)redhat.com>
Date: Sat Jul 26 15:02:01 2014 +0200
DHCP: Updates to Chapter
Thanks to ljozsa and jpopelka for their reviews.
---------------------------------------------------------------
en-US/DHCP_Servers.xml | 134 ++++++++++++++++++++++++++----------------------
1 files changed, 72 insertions(+), 62 deletions(-)
diff --git a/en-US/DHCP_Servers.xml b/en-US/DHCP_Servers.xml
index 1116210..1e2dcc5 100644
--- a/en-US/DHCP_Servers.xml
+++ b/en-US/DHCP_Servers.xml
@@ -22,6 +22,10 @@
</indexterm>
<para><systemitem class="protocol">DHCP</systemitem> is
useful for automatic configuration of client network interfaces. When configuring the
client system, you can choose <systemitem
class="protocol">DHCP</systemitem> instead of specifying an
<systemitem class="protocol">IP</systemitem> address, netmask,
gateway, or <systemitem class="protocol">DNS</systemitem> servers.
The client retrieves this information from the <systemitem
class="protocol">DHCP</systemitem> server. <systemitem
class="protocol">DHCP</systemitem> is also useful if you want to change
the <systemitem class="protocol">IP</systemitem> addresses of a
large number of systems. Instead of reconfiguring all the systems, you can just edit one
configuration file on the server for the new set of <systemitem
class="protocol">IP</systemitem> addresses. If the <systemitem
class="protocol">DNS</systemitem> servers for an organization changes,
the changes happen on the <systemitem
class="protocol">DHCP</systemitem> s
erver, not on the <systemitem class="protocol">DHCP</systemitem>
clients. When you restart the network or reboot the clients, the changes go into
effect.</para>
<para>If an organization has a functional <systemitem
class="protocol">DHCP</systemitem> server correctly connected to a
network, laptops and other mobile computer users can move these devices from office to
office.</para>
+ <para>
+ Note that administrators of <systemitem
class="protocol">DNS</systemitem> and <systemitem
class="protocol">DHCP</systemitem> servers, as well as any provisioning
applications, should agree on the host name format used in an organization. See <xref
linkend="sec-Recommended_Naming_Practices" /> for more information on the
format of host names.
+</para>
+
</section>
<section
id="sec-dhcp-configuring-server">
@@ -31,7 +35,7 @@
<secondary>server configuration</secondary>
</indexterm>
- <para>The <package>dhcp</package> package contains an
<firstterm>Internet Systems Consortium</firstterm>
(<acronym>ISC</acronym>) <systemitem
class="protocol">DHCP</systemitem> server. First, install the package
as the superuser:</para>
+ <para>The <package>dhcp</package> package contains an
<firstterm>Internet Systems Consortium</firstterm>
(<acronym>ISC</acronym>) <systemitem
class="protocol">DHCP</systemitem> server. Install the package as
<systemitem class="username">root</systemitem>:</para>
<screen>~]# <command>yum install dhcp</command>
</screen>
<para>Installing the <package>dhcp</package> package creates a
file, <filename>/etc/dhcp/dhcpd.conf</filename>, which is merely an empty
configuration file. As <systemitem
class="username">root</systemitem>, issue the following
command:</para>
@@ -54,7 +58,7 @@
<indexterm>
<primary>dhcpd.conf</primary>
</indexterm>
- <para>The first step in configuring a <systemitem
class="protocol">DHCP</systemitem> server is to create the
configuration file that stores the network information for the clients. Use this file to
declare options and global options for client systems.</para>
+ <para>The first step in configuring a <systemitem
class="protocol">DHCP</systemitem> server is to create the
configuration file that stores the network information for the clients. Use this file to
declare options for client systems.</para>
<para>The configuration file can contain extra tabs or blank lines for easier
formatting. Keywords are case-insensitive and lines beginning with a hash sign
(<literal>#</literal>) are considered comments.</para>
<para>There are two types of statements in the configuration
file:</para>
<itemizedlist>
@@ -69,7 +73,7 @@
<primary>DHCP</primary>
<secondary>options</secondary>
</indexterm>
- <para>The parameters that start with the keyword option are referred to as
<firstterm>options</firstterm>. These options control DHCP options; whereas,
parameters configure values that are not optional or control how the DHCP server
behaves.</para>
+ <para>The parameters that start with the keyword option are referred to as
<firstterm>options</firstterm>. These options control <systemitem
class="protocol">DHCP</systemitem> options; whereas, parameters
configure values that are not optional or control how the <systemitem
class="protocol">DHCP</systemitem> server behaves.</para>
<indexterm>
<primary>DHCP</primary>
<secondary>global parameters</secondary>
@@ -84,13 +88,13 @@
<para>Instead of changing a <systemitem
class="protocol">DHCP</systemitem> configuration file and restarting
the service each time, using the <command>omshell</command> command provides
an interactive way to connect to, query, and change the configuration of a <systemitem
class="protocol">DHCP</systemitem> server. By using
<command>omshell</command>, all changes can be made while the server is
running. For more information on <command>omshell</command>, see the
<command>omshell</command> man page.</para>
</note>
<para>In <xref
- linkend="subnet"/>, the <filename>routers</filename>,
<filename>subnet-mask</filename>,
<filename>domain-search</filename>,
<filename>domain-name-servers</filename>, and
<filename>time-offset</filename> options are used for any
<filename>host</filename> statements declared below it.</para>
+ linkend="subnet"/>, the <command>routers</command>,
<command>subnet-mask</command>, <command>domain-search</command>,
<command>domain-name-servers</command>, and
<command>time-offset</command> options are used for any
<command>host</command> statements declared below it.</para>
<indexterm>
<primary>DHCP</primary>
<secondary>subnet</secondary>
</indexterm>
- <para>For every <filename>subnet</filename> which will be served,
and for every <filename>subnet</filename> to which the <systemitem
class="protocol">DHCP</systemitem> server is connected, there must be
one <filename>subnet</filename> declaration, which tells the <systemitem
class="protocol">DHCP</systemitem> daemon how to recognize that an
address is on that <filename>subnet</filename>. A
<filename>subnet</filename> declaration is required for each
<filename>subnet</filename> even if no addresses will be dynamically allocated
to that <filename>subnet</filename>.</para>
- <para>In this example, there are global options for every <systemitem
class="protocol">DHCP</systemitem> client in the subnet and a
<filename>range</filename> declared. Clients are assigned an <systemitem
class="protocol">IP</systemitem> address within the
<filename>range</filename>.</para>
+ <para>For every subnet which will be served, and for every subnet to which
the <systemitem class="protocol">DHCP</systemitem> server is
connected, there must be one <command>subnet</command> declaration, which
tells the <systemitem class="protocol">DHCP</systemitem> daemon how
to recognize that an address is on that subnet. A <command>subnet</command>
declaration is required for each subnet even if no addresses will be dynamically allocated
to that subnet.</para>
+ <para>In this example, there are global options for every <systemitem
class="protocol">DHCP</systemitem> client in the subnet and a
<command>range</command> declared. Clients are assigned an <systemitem
class="protocol">IP</systemitem> address within the
<command>range</command>.</para>
<example
id="subnet">
<title>Subnet Declaration</title>
@@ -103,8 +107,7 @@
range 192.168.1.10 192.168.1.100;
}</programlisting>
</example>
- <para>To configure a <systemitem
class="protocol">DHCP</systemitem> server that leases a dynamic
<systemitem class="protocol">IP</systemitem> address to a system
within a subnet, modify <xref
- linkend="dynamic-ip"/> with your values. It declares a default
lease time, maximum lease time, and network configuration values for the clients. This
example assigns <systemitem class="protocol">IP</systemitem>
addresses in the <filename>range</filename> <systemitem
class="ipaddress">192.168.1.10</systemitem> and <systemitem
class="ipaddress">192.168.1.100</systemitem> to client
systems.</para>
+ <para>To configure a <systemitem
class="protocol">DHCP</systemitem> server that leases a dynamic
<systemitem class="protocol">IP</systemitem> address to a system
within a subnet, modify the example values from <xref
linkend="dynamic-ip"/>. It declares a default lease time, maximum lease time,
and network configuration values for the clients. This example assigns <systemitem
class="protocol">IP</systemitem> addresses in the
<command>range</command> <systemitem
class="ipaddress">192.168.1.10</systemitem> and <systemitem
class="ipaddress">192.168.1.100</systemitem> to client
systems.</para>
<example
id="dynamic-ip">
<title>Range Parameter</title>
@@ -119,9 +122,9 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
}</programlisting>
</example>
- <para>To assign an <systemitem
class="protocol">IP</systemitem> address to a client based on the MAC
address of the network interface card, use the <filename>hardware
ethernet</filename> parameter within a <filename>host</filename>
declaration. As demonstrated in <xref
- linkend="static-ip"/>, the <filename>host
apex</filename> declaration specifies that the network interface card with the MAC
address <systemitem
class="etheraddress">00:A0:78:8E:9E:AA</systemitem> always receives the
<systemitem class="protocol">IP</systemitem> address <systemitem
class="ipaddress">192.168.1.4</systemitem>.</para>
- <para>Note that you can also use the optional parameter
<filename>host-name</filename> to assign a host name to the
client.</para>
+ <para>To assign an <systemitem
class="protocol">IP</systemitem> address to a client based on the MAC
address of the network interface card, use the <command>hardware
ethernet</command> parameter within a <command>host</command>
declaration. As demonstrated in <xref
+ linkend="static-ip"/>, the <command>host
apex</command> declaration specifies that the network interface card with the MAC
address <systemitem
class="etheraddress">00:A0:78:8E:9E:AA</systemitem> always receives the
<systemitem class="protocol">IP</systemitem> address <systemitem
class="ipaddress">192.168.1.4</systemitem>.</para>
+ <para>Note that you can also use the optional parameter
<option>host-name</option> to assign a host name to the client.</para>
<example
id="static-ip">
<title>Static IP Address Using DHCP</title>
@@ -133,12 +136,10 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
</example>
<indexterm>
<primary>DHCP</primary>
- <secondary>
- <filename>shared-network</filename>
- </secondary>
+ <secondary><command>shared-network</command></secondary>
</indexterm>
- <para>All subnets that share the same physical network should be declared
within a <filename>shared-network</filename> declaration as shown in <xref
- linkend="shared-network"/>. Parameters within the
<filename>shared-network</filename>, but outside the enclosed
<filename>subnet</filename> declarations, are considered to be global
parameters. The name of the <filename>shared-network</filename> must be a
descriptive title for the network, such as using the title 'test-lab' to describe
all the subnets in a test lab environment.</para>
+ <para>All subnets that share the same physical network should be declared
within a <command>shared-network</command> declaration as shown in <xref
+ linkend="shared-network"/>. Parameters within the
<command>shared-network</command>, but outside the enclosed subnet
declarations, are considered to be global parameters. The name assigned to
<command>shared-network</command> must be a descriptive title for the network,
such as using the title <quote>test-lab</quote> to describe all the subnets in
a test lab environment.</para>
<example
id="shared-network">
<title>Shared-network Declaration</title>
@@ -146,13 +147,13 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-search "test.redhat.com";
option domain-name-servers
ns1.redhat.com,
ns2.redhat.com;
option routers 192.168.0.254;
- more parameters for EXAMPLE shared-network
+ #more parameters for EXAMPLE shared-network
subnet 192.168.1.0 netmask 255.255.252.0 {
- parameters for subnet
+ #parameters for subnet
range 192.168.1.1 192.168.1.254;
}
subnet 192.168.2.0 netmask 255.255.252.0 {
- parameters for subnet
+ #parameters for subnet
range 192.168.2.1 192.168.2.254;
}
}</programlisting>
@@ -162,7 +163,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
<secondary>group</secondary>
</indexterm>
<para>As demonstrated in <xref
- linkend="group"/>, the <filename>group</filename>
declaration is used to apply global parameters to a group of declarations. For example,
shared networks, subnets, and hosts can be grouped.</para>
+ linkend="group"/>, the <command>group</command>
declaration is used to apply global parameters to a group of declarations. For example,
shared networks, subnets, and hosts can be grouped.</para>
<example
id="group">
<title>Group Declaration</title>
@@ -186,19 +187,19 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
</example>
<note>
<title>Using the Example Configuration File</title>
- <para>The example configuration file provided can be used as a starting
point and custom configuration options can be added to it. To copy it to the proper
location, use the following command:</para>
-<screen><command>cp /usr/share/doc/dhcp/dhcpd.conf.example
/etc/dhcp/dhcpd.conf</command></screen>
-
+ <para>You can use the provided example configuration file as a starting
point and add custom configuration options to it. To copy this file to the proper
location, use the following command as <systemitem
class="username">root</systemitem>:</para>
+ <screen>~]# <command>cp
/usr/share/doc/dhcp-<replaceable><version_number></replaceable>/dhcpd.conf.example
/etc/dhcp/dhcpd.conf</command></screen>
+ <para>... where
<replaceable><version_number></replaceable> is the
<systemitem class="protocol">DHCP</systemitem> version
number.</para>
</note>
- <para>For a complete list of option statements and what they do, refer to the
<filename>dhcp-options</filename> man page.</para>
+ <para>For a complete list of option statements and what they do, see the
<filename>dhcp-options(5)</filename> man page.</para>
</section>
<section
id="lease-database">
<title>Lease Database</title>
- <para>On the DHCP server, the file
<filename>/var/lib/dhcpd/dhcpd.leases</filename> stores the DHCP client lease
database. Do not change this file. DHCP lease information for each recently assigned IP
address is automatically stored in the lease database. The information includes the length
of the lease, to whom the IP address has been assigned, the start and end dates for the
lease, and the MAC address of the network interface card that was used to retrieve the
lease.</para>
+ <para>On the <systemitem
class="protocol">DHCP</systemitem> server, the file
<filename>/var/lib/dhcpd/dhcpd.leases</filename> stores the <systemitem
class="protocol">DHCP</systemitem> client lease database. Do not change
this file. <systemitem class="protocol">DHCP</systemitem> lease
information for each recently assigned <systemitem
class="protocol">IP</systemitem> address is automatically stored in the
lease database. The information includes the length of the lease, to whom the
<systemitem class="protocol">IP</systemitem> address has been
assigned, the start and end dates for the lease, and the MAC address of the network
interface card that was used to retrieve the lease.</para>
<para>All times in the lease database are in Coordinated Universal Time
(UTC), not local time.</para>
<para>The lease database is recreated from time to time so that it is not too
large. First, all known leases are saved in a temporary lease database. The
<filename>dhcpd.leases</filename> file is renamed
<filename>dhcpd.leases~</filename> and the temporary lease database is written
to <filename>dhcpd.leases</filename>.</para>
- <para>The DHCP daemon could be killed or the system could crash after the
lease database has been renamed to the backup file but before the new file has been
written. If this happens, the <filename>dhcpd.leases</filename> file does not
exist, but it is required to start the service. Do not create a new lease file. If you do,
all old leases are lost which causes many problems. The correct solution is to rename the
<filename>dhcpd.leases~</filename> backup file to
<filename>dhcpd.leases</filename> and then start the daemon.</para>
+ <para>The <systemitem
class="protocol">DHCP</systemitem> daemon could be killed or the system
could crash after the lease database has been renamed to the backup file but before the
new file has been written. If this happens, the
<filename>dhcpd.leases</filename> file does not exist, but it is required to
start the service. Do not create a new lease file. If you do, all old leases are lost
which causes many problems. The correct solution is to rename the
<filename>dhcpd.leases~</filename> backup file to
<filename>dhcpd.leases</filename> and then start the daemon.</para>
</section>
<section>
<title>Starting and Stopping the Server</title>
@@ -212,21 +213,21 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
</indexterm>
<indexterm>
<primary>DHCP</primary>
- <secondary>
- <filename>dhcpd.leases</filename>
- </secondary>
+ <secondary><filename>dhcpd.leases</filename></secondary>
</indexterm>
<indexterm>
<primary>dhcpd.leases</primary>
</indexterm>
<important>
<title>Starting the DHCP Server for the First Time</title>
- <para>When the <systemitem
class="protocol">DHCP</systemitem> server is started for the first
time, it fails unless the <filename>dhcpd.leases</filename> file exists. Use
the command <command>touch /var/lib/dhcpd/dhcpd.leases</command> to create the
file if it does not exist.</para>
- <para>If the same server is also running BIND as a <systemitem
class="protocol">DNS</systemitem> server, this step is not necessary,
as starting the <command>named</command> service automatically checks for a
<filename>dhcpd.leases</filename> file.</para>
+ <para>When the <systemitem
class="protocol">DHCP</systemitem> server is started for the first
time, it fails unless the <filename>dhcpd.leases</filename> file exists. You
can use the command <command>touch /var/lib/dhcpd/dhcpd.leases</command> to
create the file if it does not exist. If the same server is also running BIND as a
<systemitem class="protocol">DNS</systemitem> server, this step is
not necessary, as starting the <command>named</command> service automatically
checks for a <filename>dhcpd.leases</filename> file.</para>
+ <para>
+ Do not create a new lease file on a system that was previously running. If you
do, all old leases are lost which causes many problems. The correct solution is to rename
the <filename>dhcpd.leases~</filename> backup file to
<filename>dhcpd.leases</filename> and then start the daemon.
+ </para>
</important>
- <para>To start the DHCP service, use the following command:</para>
+ <para>To start the <systemitem
class="protocol">DHCP</systemitem> service, use the following
command:</para>
<screen><command>systemctl start
dhcpd.service</command></screen>
- <para>To stop the DHCP server, type:</para>
+ <para>To stop the <systemitem
class="protocol">DHCP</systemitem> server, type:</para>
<screen><command>systemctl stop
dhcpd.service</command></screen>
<para>By default, the DHCP service does not start at boot time. To configure
the daemon to start automatically at boot time, run:</para>
<screen><command>systemctl enable
dhcpd.service</command></screen>
@@ -242,17 +243,23 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
<primary>DHCP</primary>
<secondary>command line options</secondary>
</indexterm>
- <para>If more than one network interface is attached to the system, but the
DHCP server should only be started on one of the interfaces, configure the DHCP server to
start only on that device. In <filename>/etc/sysconfig/dhcpd</filename>, add
the name of the interface to the list of
<command>DHCPDARGS</command>:</para>
- <programlisting># Command line options here
-DHCPDARGS=eth0</programlisting>
- <para>This is useful for a firewall machine with two network cards. One
network card can be configured as a DHCP client to retrieve an IP address to the Internet.
The other network card can be used as a DHCP server for the internal network behind the
firewall. Specifying only the network card connected to the internal network makes the
system more secure because users can not connect to the daemon via the
Internet.</para>
- <para>Other command line options that can be specified in
<filename>/etc/sysconfig/dhcpd</filename> include:</para>
+ <para>If more than one network interface is attached to the system, but the
<systemitem class="protocol">DHCP</systemitem> server should only
listen for <systemitem class="protocol">DHCP</systemitem> requests
on one of the interfaces, configure the <systemitem
class="protocol">DHCP</systemitem> server to listen only on that
device. The <systemitem class="protocol">DHCP</systemitem> daemon
will only listen on interfaces for which it finds a subnet declaration in the
<filename>/etc/dhcp/dhcpd.conf</filename> file.</para>
+ <para>This is useful for a firewall machine with two network cards. One
network card can be configured as a <systemitem
class="protocol">DHCP</systemitem> client to retrieve an <systemitem
class="protocol">IP</systemitem> address to the Internet. The other
network card can be used as a <systemitem
class="protocol">DHCP</systemitem> server for the internal network
behind the firewall. Specifying only the network card connected to the internal network
makes the system more secure because users can not connect to the daemon via the
Internet.</para>
+ <para>
+ To specify command line options, copy and then edit the
<filename>dhcpd.service</filename> file as the <systemitem
class="username">root</systemitem> user. For example, as follows:
+ <screen>~]# <command>cp /usr/lib/systemd/system/dhcpd.service
/etc/systemd/system/</command>
+~]# <command>vi /etc/systemd/system/dhcpd.service</command></screen>
+Edit the line under section [Service]:
+<synopsis>ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group
dhcpd --no-pid
<replaceable>your_interface_name(s)</replaceable></synopsis>
+Then, as the <systemitem class="username">root</systemitem> user,
restart the service:
+<screen>~]# <command>systemctl --system daemon-reload</command>
+~]# <command>systemctl restart dhcpd</command></screen>
+ </para>
+ <para>Command line options can be appended to
<command>ExecStart=/usr/sbin/dhcpd</command> in the
<filename>/etc/systemd/system/dhcpd.service</filename> unit file under section
[Service]. They include:</para>
<itemizedlist>
<listitem>
<para>
- <command>-p <replaceable>portnum</replaceable>
- </command> — Specifies the UDP port number on which
<command>dhcpd</command> should listen. The default is port 67. The DHCP
server transmits responses to the DHCP clients at a port number one greater than the UDP
port specified. For example, if the default port 67 is used, the server listens on port 67
for requests and responses to the client on port 68. If a port is specified here and the
DHCP relay agent is used, the same port on which the DHCP relay agent should listen must
be specified. Refer to <xref
- linkend="dhcp-relay-agent"/> for details.</para>
+ <command>-p
<replaceable><portnum></replaceable></command> — Specifies
the UDP port number on which <command>dhcpd</command> should listen. The
default is port 67. The <systemitem
class="protocol">DHCP</systemitem> server transmits responses to the
<systemitem class="protocol">DHCP</systemitem> clients at a port
number one greater than the UDP port specified. For example, if the default port 67 is
used, the server listens on port 67 for requests and responds to the client on port 68. If
a port is specified here and the <systemitem
class="protocol">DHCP</systemitem> relay agent is used, the same port
on which the <systemitem class="protocol">DHCP</systemitem> relay
agent should listen must be specified. See <xref linkend="dhcp-relay-agent"
/> for details.</para>
</listitem>
<listitem>
<para>
@@ -270,7 +277,7 @@ DHCPDARGS=eth0</programlisting>
<listitem>
<para>
<command>-lf <replaceable>filename</replaceable>
- </command> — Specifies the location of the lease database file. If a
lease database file already exists, it is very important that the same file be used every
time the DHCP server is started. It is strongly recommended that this option only be used
for debugging purposes on non-production machines. The default location is
<filename>/var/lib/dhcpd/dhcpd.leases</filename>.</para>
+ </command> — Specifies the location of the lease database file. If a
lease database file already exists, it is very important that the same file be used every
time the <systemitem class="protocol">DHCP</systemitem> server is
started. It is strongly recommended that this option only be used for debugging purposes
on non-production machines. The default location is
<filename>/var/lib/dhcpd/dhcpd.leases</filename>.</para>
</listitem>
<listitem>
<para>
@@ -287,18 +294,21 @@ DHCPDARGS=eth0</programlisting>
</indexterm>
<indexterm>
<primary>DHCP</primary>
- <secondary>
- dhcrelay
- </secondary>
+ <secondary>dhcrelay</secondary>
</indexterm>
<indexterm>
- <primary>
- dhcrelay
- </primary>
+ <primary>dhcrelay</primary>
</indexterm>
- <para>The DHCP Relay Agent (<command>dhcrelay</command>) allows
for the relay of DHCP and BOOTP requests from a subnet with no DHCP server on it to one or
more DHCP servers on other subnets.</para>
- <para>When a DHCP client requests information, the DHCP Relay Agent forwards
the request to the list of DHCP servers specified when the DHCP Relay Agent is started.
When a DHCP server returns a reply, the reply is broadcast or unicast on the network that
sent the original request.</para>
+ <para>
+ The DHCP Relay Agent (<application>dhcrelay</application>) enables the
relay of <systemitem class="protocol">DHCP</systemitem> and
<systemitem class="protocol">BOOTP</systemitem> requests from a
subnet with no <systemitem class="protocol">DHCP</systemitem> server
on it to one or more <systemitem class="protocol">DHCP</systemitem>
servers on other subnets.
+ </para>
+
+ <para>
+ When a <systemitem class="protocol">DHCP</systemitem> client
requests information, the DHCP Relay Agent forwards the request to the list of
<systemitem class="protocol">DHCP</systemitem> servers specified
when the DHCP Relay Agent is started. When a <systemitem
class="protocol">DHCP</systemitem> server returns a reply, the reply is
broadcast or unicast on the network that sent the original request.
+ </para>
+
<para>The DHCP Relay Agent listens for DHCP requests on all interfaces unless
the interfaces are specified in <filename>/etc/sysconfig/dhcrelay</filename>
with the <computeroutput>INTERFACES</computeroutput> directive.</para>
+
<para>To start the DHCP Relay Agent, use the following command:</para>
<screen><command>systemctl start
dhcrelay.service</command></screen>
</section>
@@ -311,13 +321,12 @@ DHCPDARGS=eth0</programlisting>
<primary>Multihomed DHCP</primary>
<secondary>server configuration</secondary>
</indexterm>
- <para>A multihomed DHCP server serves multiple networks, that is, multiple
subnets. The examples in these sections detail how to configure a DHCP server to serve
multiple networks, select which network interfaces to listen on, and how to define network
settings for systems that move networks.</para>
- <para>Before making any changes, back up the existing
<filename>/etc/sysconfig/dhcpd</filename> and
<filename>/etc/dhcp/dhcpd.conf</filename> files.</para>
- <para>The DHCP daemon listens on all network interfaces unless otherwise
specified. Use the <filename>/etc/sysconfig/dhcpd</filename> file to specify
which network interfaces the DHCP daemon listens on. The following
<filename>/etc/sysconfig/dhcpd</filename> example specifies that the DHCP
daemon listens on the <filename>eth0</filename> and
<filename>eth1</filename> interfaces:</para>
- <programlisting>DHCPDARGS="eth0 eth1";</programlisting>
- <para>If a system has three network interfaces cards --
<filename>eth0</filename>, <filename>eth1</filename>, and
<filename>eth2</filename> -- and it is only desired that the DHCP daemon
listens on <filename>eth0</filename>, then only specify
<computeroutput>eth0</computeroutput> in
<filename>/etc/sysconfig/dhcpd</filename>:</para>
- <programlisting>DHCPDARGS="eth0";</programlisting>
- <para>The following is a basic
<filename>/etc/dhcp/dhcpd.conf</filename> file, for a server that has two
network interfaces, <filename>eth0</filename> in a 10.0.0.0/24 network, and
<filename>eth1</filename> in a 172.16.0.0/24 network. Multiple
<computeroutput>subnet</computeroutput> declarations allow different settings
to be defined for multiple networks:</para>
+ <para>A multihomed <systemitem
class="protocol">DHCP</systemitem> server serves multiple networks,
that is, multiple subnets. The examples in these sections detail how to configure a
<systemitem class="protocol">DHCP</systemitem> server to serve
multiple networks, select which network interfaces to listen on, and how to define network
settings for systems that move networks.</para>
+ <para>Before making any changes, back up the existing
<filename>/etc/dhcp/dhcpd.conf</filename> file.</para>
+ <para>The <systemitem class="protocol">DHCP</systemitem>
daemon will only listen on interfaces for which it finds a subnet declaration in the
<filename>/etc/dhcp/dhcpd.conf</filename> file.</para>
+ <para>The following is a basic
<filename>/etc/dhcp/dhcpd.conf</filename> file, for a server that has two
network interfaces, <interface>eth0</interface> in a <systemitem
class="ipaddress">10.0.0.0/24</systemitem> network, and
<interface>eth1</interface> in a <systemitem
class="ipaddress">172.16.0.0/24</systemitem> network. Multiple
<computeroutput>subnet</computeroutput> declarations allow you to define
different settings for multiple networks:</para>
+
+
<programlisting>default-lease-time <replaceable>600</replaceable>;
max-lease-time <replaceable>7200</replaceable>;
subnet 10.0.0.0 netmask 255.255.255.0 {
@@ -336,8 +345,8 @@ subnet 172.16.0.0 netmask 255.255.255.0 {
<computeroutput>subnet <replaceable>10.0.0.0</replaceable>
netmask <replaceable>255.255.255.0</replaceable>;</computeroutput>
</term>
<listitem>
- <para>A <computeroutput>subnet</computeroutput> declaration
is required for every network your DHCP server is serving. Multiple subnets require
multiple <computeroutput>subnet</computeroutput> declarations. If the DHCP
server does not have a network interface in a range of a
<computeroutput>subnet</computeroutput> declaration, the DHCP server does not
serve that network.</para>
- <para>If there is only one
<computeroutput>subnet</computeroutput> declaration, and no network interfaces
are in the range of that subnet, the DHCP daemon fails to start, and an error such as the
following is logged to <filename>/var/log/messages</filename>:</para>
+ <para>A <computeroutput>subnet</computeroutput> declaration
is required for every network your <systemitem
class="protocol">DHCP</systemitem> server is serving. Multiple subnets
require multiple <computeroutput>subnet</computeroutput> declarations. If the
<systemitem class="protocol">DHCP</systemitem> server does not have
a network interface in a range of a <computeroutput>subnet</computeroutput>
declaration, the <systemitem class="protocol">DHCP</systemitem>
server does not serve that network.</para>
+ <para>If there is only one
<computeroutput>subnet</computeroutput> declaration, and no network interfaces
are in the range of that subnet, the <systemitem
class="protocol">DHCP</systemitem> daemon fails to start, and an error
such as the following is logged to
<filename>/var/log/messages</filename>:</para>
<programlisting>dhcpd: No subnet declaration for eth0 (0.0.0.0).
dhcpd: ** Ignoring requests on eth0. If this is not what
dhcpd: you want, please write a subnet declaration
@@ -373,8 +382,9 @@ dhcpd: Not configured to listen on any
interfaces!</programlisting>
</listitem>
</varlistentry>
</variablelist>
- <para>For further information, see the
<computeroutput>dhcpd.conf(5)</computeroutput> man page.</para>
- <section
+ <para>For further information, see the
<filename>dhcpd.conf(5)</filename> man page.</para>
+
+ <section
id="sec-dns_Host_Configuration">
<title>Host Configuration</title>
<indexterm>
@@ -464,7 +474,7 @@ host interface1 {
<para>make the name in the
<computeroutput>host</computeroutput> declaration unique.</para>
</listitem>
</itemizedlist>
- <para>When a name given in a
<computeroutput>host</computeroutput> declaration is not unique, the DHCP
daemon fails to start, and an error such as the following is logged to
<filename>/var/log/messages</filename>:</para>
+ <para>When a name given in a
<computeroutput>host</computeroutput> declaration is not unique, the
<systemitem class="protocol">DHCP</systemitem> daemon fails to
start, and an error such as the following is logged to
<filename>/var/log/messages</filename>:</para>
<programlisting>dhcpd: /etc/dhcp/dhcpd.conf line 31: host interface0: already
exists
dhcpd: }
dhcpd: ^