Installation guide

Chapter 12. Dynamic Host Configuration Protocol (DHCP) 115
To start the DHCP service, use the command /sbin/service dhcpd start. To stop the
DHCP server, use the command /sbin/service dhcpd stop. If you want the daemon to
start automatically at boot time, see Chapter 8 for information on how to manage services.
If you have more than more network interface attached to the system, but you only want
the DHCP server to start on one of the interface, you can configure the DHCP server to start
only on that device. In /etc/sysconfig/dhcpd, add the name of the interface to the list of
DHCPDARGS:
# Command line options here
DHCPDARGS=eth0
This is useful if you have 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.
Other command line options that can be specified in /etc/sysconfig/dhcpd include:
-p
portnum Specify the udp port number on which dhcpd should listen. The de-
fault is port 67. The DHCP server transmits responses to the DHCP clients at a port num-
ber one greater than the udp port specified. For example, if you accept the default of port
67, the server listens on port 67 for requests and responses to the client on port 68. If you
specify a port here and use the DHCP relay agent, you must specify the same port on
which the DHCP relay agent should listen. See Section 12.2.4 for details.
-f — Run the daemon as a foreground process. This is mostly used for debugging.
-d Log the DHCP server daemon to the standard error descriptor. This is mostly used
for debugging. If this is not specified, the log is written to /var/log/messages.
-cf filename Specify the location of the configuration file. The default location is
/etc/dhcpd.conf.
-lf filename Specify 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 /var/lib/dhcp/dhcpd.leases.
-q — Do not print the entire copyright message when starting the daemon.
12.2.4. DHCP Relay Agent
The DHCP Relay Agent (dhcrelay) allows you to relay DHCP and BOOTP requests from a
subnet with no DHCP server on it to one or more DHCP servers on other subnets.
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.
The DHCP Relay Agent listens for DHCP requests on all interfaces unless the -i argument
is used to specify one or more interfaces to listen to.
To start the DHCP Relay Agent, use the dhcrelay command followed by the name of at
least one DHCP server to which the requests should be relayed. It can be started with the
following options: