Internet Protocol: DHCP: Dynamic Host Configuration Protocol (DHCP) Is A Protocol Used by Networked
Internet Protocol: DHCP: Dynamic Host Configuration Protocol (DHCP) Is A Protocol Used by Networked
Even for servers whose addresses rarely change, DHCP is recommended for setting their
addresses, so if the servers need to be readdressed (RFC2071), the changes need to be
made in as few places as possible. For devices, such as routers and firewalls, that should
not use DHCP, it can be useful to put Trivial File Transfer Protocol (TFTP) or SSH
servers on the same machine that runs DHCP, again to centralize administration.
DHCP is also useful for directly assigning addresses to servers and desktop machines,
and, through a Point-to-Point Protocol (PPP) proxy, for dialup and broadband on-demand
hosts, as well as for residential Network address translation (NAT) gateways and routers.
DHCP is usually not appropriate for infrastructure such as non-edge routers and DNS
servers.
When a DHCP-configured client (be it a computer or any other network aware device)
connects to a network, the DHCP client sends a broadcast query requesting necessary
information from a DHCP server. The DHCP server manages a pool of IP addresses and
information about client configuration parameters such as the default gateway, the
domain name, the DNS servers, other servers such as time servers, and so forth. Upon
receipt of a valid request the server will assign the computer an IP address, a lease (the
length of time for which the allocation is valid), and other TCP/IP configuration
parameters, such as the subnet mask and the default gateway. The query is typically
initiated immediately after booting and must be completed before the client can initiate
IP-based communication with other hosts.
DHCP provides three modes for allocating IP addresses. The best-known mode is
dynamic, in which the client is provided a "lease" on an IP address for a period of time.
Depending on the stability of the network, this could range from hours (a wireless
network at an airport) to months (for desktops in a wired lab). At any time before the
lease expires, the DHCP client can request renewal of the lease on the current IP address.
A properly-functioning client will use the renewal mechanism to maintain the same IP
address throughout its connection to a single network, otherwise it may risk losing its
lease while still connected, thus disrupting network connectivity while it renegotiates
with the server for its original or a new IP address.
The two other modes for allocation of IP addresses are automatic (also known as DHCP
Reservation), in which the address is permanently assigned to a client, and manual, in
which the address is selected by the client (manually by the user or any other means) and
the DHCP protocol messages are used to inform the server that the address has been
allocated.
The automatic and manual methods are generally used when finer-grained control over IP
address is required (typical of tight firewall setups), although typically a firewall will
allow access to the range of IP addresses that can be dynamically allocated by the DHCP
server.
Security
Due to its standardization before Internet security became an issue, the basic DHCP
protocol does not include any security provisions, potentially exposing it to two types of
attacks:[2]
• Unauthorized DHCP Servers: as you can not specify the server you want, an
unauthorized server can respond to client requests, sending the client network
configuration values that are beneficial to a hijacker. As an example, a hacker can
configure the DHCP server to configure clients to a DNS server which has been
poisoned.
To combat these threats RFC 3118 ("Authentication for DHCP Messages") introduced
authentication information into DHCP messages allowing clients and servers to reject
information from invalid sources. Although support for this protocol is widespread, a
large number of clients and servers still do not fully support authentication, thus forcing
servers to support clients that do not support this feature. As a result, other security
measures are usually implemented around the DHCP server (such as IPsec) to ensure that
only authenticated clients and servers are granted access to the network.
IP address allocation
Depending on implementation, the DHCP server has three methods of allocating IP-
addresses (WARNING--the terminolgy below contradicts the terminolgy above in
#Basic_Protocol_Operation):
Some DHCP server software can manage hosts by more than one of the above methods.
For example, the known hosts on the network can be assigned an IP address based on
their MAC address (manual allocation) whereas "guest" computers (such as laptops via
WiFi) are allocated a temporary address out of a pool compatible with the network to
which they're attached (dynamic allocation).