0% found this document useful (0 votes)
9 views6 pages

DHCP

The document provides an overview of Dynamic Host Configuration Protocol (DHCP), detailing its function in automatically assigning IP information to clients through a four-phase transaction process known as DORA. It includes instructions for installing and configuring the DHCP service, setting up a subnet, assigning static IP addresses, and configuring DHCP clients. Key components such as lease databases and configuration files are also discussed to assist users in managing DHCP services effectively.

Uploaded by

vik300744
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

DHCP

The document provides an overview of Dynamic Host Configuration Protocol (DHCP), detailing its function in automatically assigning IP information to clients through a four-phase transaction process known as DORA. It includes instructions for installing and configuring the DHCP service, setting up a subnet, assigning static IP addresses, and configuring DHCP clients. Key components such as lease databases and configuration files are also discussed to assist users in managing DHCP services effectively.

Uploaded by

vik300744
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

GETTING STARTED

WITH
DHCP SERVICES

Jasmitha Chukka
[email protected]
​ DHCP SERVICES:

●​ Dynamic Host Configuration Protocol (DHCP) is a network protocol that


automatically assigns IP information to clients.
●​ Each DHCP client connects to the centrally located DHCP server, which
returns the network configuration (IP address, Gateway, and DNS Servers)
of the client.
●​ Dynamic IP addresses are more flexible, easier to set up, and administer.
The DHCP is a traditional method of dynamically assigning network
configurations to hosts.

DHCP TRANSACTION PHASES:


●​ The DHCP works in four phases: Discovery, Offer, Request,
Acknowledgement, also called the DORA process.
●​ DHCP uses this process to provide IP addresses to clients.

DISCOVERY:

●​ The DHCP client sends a message to discover the DHCP server in the
network. This message is broadcasted at the network and data link layer.
OFFER:

●​ DHCP server receives messages from the client and offers an IP address to
the DHCP client. This message is unicast at the data link layer but broadcast
at the network layer.
REQUEST:

●​ The DHCP client requests the DHCP server for the offered IP address. This
message is unicast at the data link layer but broadcast at the network layer.
ACKNOWLEDGMENT:

●​ The DHCP server sends an acknowledgment to the DHCP client. This


message is unicast at the data link layer but broadcast at the network layer.

LEASE DATABASE:
●​ A DHCP lease is the time period for which the dhcpd service allocates
a network address to a client.
●​ All times in the lease database are in Coordinated Universal Time (UTC),
not local time.
●​ The dhcpd lease database’s location: “/var/lib/dhcpd/dhcpd.leases”.

❖​ DHCPD INSTALLATION AND CONFIGURATION:

PRE-REQUISITES:

▪​ Package names​ : dhcp-server, dhcp-client

▪​ Sample config file​ : /usr/share/doc/dhcp-server/dhcpd.conf.sample

▪​ Main config file​ : /etc/dhcp/dhcpd.conf

▪​ Client lease database: /var/lib/dhcpd/dhcpd.lease

▪​ Service / Daemon​ : dhcpd

▪​ Ports​ : bootp-67, dhcp-68

→ Installing dhcp-server package:

#dnf install dhcp-server -y

→ Reload the systemd manager configuration:

#systemctl daemon-reload

→ Start and enable the dhcpd service:

#systemctl start dhcpd


#systemctl enable dhcpd
→ Verify the status of the dhcpd:

#systemctl status dhcpd


→ Copy sample configuration file to main config file:

#cp /usr/share/doc/dhcp-server/dhcpd.conf.example /etc/dhcp/dhcpd.conf

SETTING UP THE DHCP SERVICE FOR SUBNET:

→ Edit the /etc/dhcp/dhcpd.conf file:

#A slightly different configuration for an internal subnet.


subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.99;
option domain-name-servers ns1.internal.example.org;
option domain-name "example.com";
option routers 192.168.10.1;
option broadcast-address 192.168.10.255;
default-lease-time 86400;​ #One day lease time
max-lease-time 172800;​ #Two days max lease time
}

→ Add the authoritative statement in a last line of same config file:

authoritative;
NOTE:

Without the authoritative statement, the dhcpd service does not


answer DHCPREQUEST messages with DHCPNAK if a client asks
for an address that is outside of the pool.

→ Restart the dhcpd service:

#systemctl start dhcpd


#systemctl status dhcpd
ASSIGNING A STATIC ADDRESS TO A HOST USING DHCP:
●​ Assigning IP address dynamically has some problem that every time a
client system boots it is not sure that it will get the same IP address.
●​ Using a host declaration, you can configure the DHCP server to assign
a fixed IP address to a media access control (MAC) address of a host.

→ First find client system ipaddress and MAC address:

#arp

→ Edit the /etc/dhcp/dhcpd.conf file:


host client {
hardware ethernet 00:0c:29:54:a2:3e;
fixed-address 192.168.10.10;
}

#systemctl start dhcpd

❖​ DHCP CLIENT CONFIGURATION:


●​ By default, NetworkManager uses its internal DHCP client. However, if you
require a DHCP client, you can alternatively configure NetworkManager to
use dhclient.
#dnf install dhcp-client -y

→ Edit /etc/NetworkManager/conf.d/dhcp-client.conf file following


content:
[main]
dhcp=dhclient

→ Edit /etc/NetworkManager/system-connections/ens160.nmconnection

[ipv4]
method=auto

#systemctl restart NetworkManager


#ifconfig

You might also like