Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol
PROTOCOL
PhD. Alcides Montoya Canola, Est. Carlos Andres Ballesteros
Universidad Nacional de Colombia - sede Medellin
Abstract
This guide will develop the procedure that will allow you to practice
the knowledge acquired in the theoretical class of server management.
The topic to be developed is DHCP.
1 Introduction
The purpose of the Dynamic Host Configuration Protocol (DHCP) is to assign
network settings centrally (from a server) rather than configuring them locally
on every workstation. A host configured to use DHCP does not have control over
its own static address. It is enabled to configure itself completely and automat-
ically according to directions from the server. If you use the NetworkManager
on the client side, you do not need to configure the client. This is useful if you
have changing environments and only one interface active at a time. Never use
NetworkManager on a machine that runs a DHCP server.[1].
1
2 DHCP lease process
A DHCP-enabled client obtains a grant for an IP address from a DHCP server.
This concept is like a lease for a certain time, once the contract expires there
is a period of grace in which the DHCP server waits for a new renewal of the
contract. contract, This protects the lease of clients in case the client and the
server are in different time zones, the internal clocks of the client and server
computers. they are not synchronized, or the client is out of the network when
the lease expires.
2
option. Upon receiving the DHCPAck, the customer can use the leased IP
address to participate in the TCP / IP network and complete the system
startup. This message is usually transmitted, because the DHCP client
does not officially have an IP address that it can use at this time. If
the DHCPAck responds to a DHCPInform, then the message is unicast
directly to the host that sent the DHCPInform message.
• DHCPNack: Transmission by a DHCP server to a DHCP client that
denies the client’s DHCPRequest message. This can occur if the requested
address is incorrect because the client moved to a new subnet or because
the DHCP client lease has expired and can not be renewed.
• DHCPDecline:Transmit from a DHCP client to a DHCP server, inform-
ing the server that the offered IP address is rejected because it seems to
be in use by another computer.
3 DHCP service
A DHCP server supplies not only the IP address and the netmask, but also the
host name, domain name, gateway, and name server addresses for the client to
use. In addition to that, DHCP allows several parameters to be configured in
a centralized way, for example, a time server from which clients may poll the
current time or even a print server. RFC 2132 [2]
4 Development of Practice
The development of the practice will take place in the distribution of Open Suse
Leap 15, it is clear that this practice can be extended to other distributions
taking into account their respective changes.
3
Execute the following to configuration in graphic mode with yast :
4.2 Start service and add the service to the system boot.
dhcp is a service that must be started once it has been configured. And it must
be stopped when some new configuration is going to be done, to do this execute
the following commands.
Execute the following to start the service for the first time:
4
4.4 Files and configuration directories.
• /etc/dhcpd.conf: in this file the network parameters that the dhcp
server should follow are configured.
• /etc/sysconfig/dhcpd:file is used to pass arguments to the dhcpd dae-
mon at boot time.
• The line option domain-name defines the default domain of your network.
• With the entry option domain-name-servers, specify up to three values for
the DNS servers used to resolve IP addresses into host names and vice
versa. Ideally, configure a name server on your machine or somewhere else
in your network before setting up DHCP. That name server should also
define a host name for each dynamic address and vice versa. To learn how
to configure your own name server.
• The line option broadcast-address defines the broadcast address the re-
questing client should use.
• With option routers, set where the server should send data packets that
cannot be delivered to a host on the local network (according to the source
and target host address and the subnet mask provided). Usually, espe-
cially in smaller networks, this router is identical to the Internet gateway.
option subnet-mask, specify the netmask assigned to clients. first one
defines how many seconds an IP address is leased to a requesting client
5
by default (default-lease-time) before it should apply for renewal. section
also includes a statement of the maximum period for which a machine
may keep an IP address assigned by the DHCP server without applying
for renewal (max-lease-time).
To identify a client configured with a static address, dhcpd uses the hardware
address (which is a global unique fixed numeric code consisting of six pairs of
octets) for the identification of all network devices (for example, 00: 30: 6E:
08: EC: 80). If the respective lines, as shown above, the DHCP daemon always
assigns the same data set to the corresponding client. The name of the respective
client (host HOSTNAME, here fantasy) is entered in the first line and the MAC
address in the second.
5 Exercise
Install and configure a DHCP server, as shown throughout the development of
the practice, mount a network and try it, also configure another server using
yast.
References
[1] DHCP/openSUSE Leap 15.0”, doc.opensuse.org 2018
[2] How-does-DHCP-work/quora”, www.quora.com 2018