top of page
Writer's pictureRomit Kakadiya

Understanding DHCP: Dynamic Host Configuration Protocol

Updated: Feb 12, 2024


DHCP Overview


In the vast realm of networking, the IP address stands as a fundamental pillar, facilitating communication among network devices. Whether assigned statically or dynamically, the IP address plays a crucial role in enabling seamless connectivity. Dynamic Host Configuration Protocol (DHCP) emerges as a pivotal mechanism in managing and assigning IP addresses dynamically, streamlining network administration processes. DHCP streamlines the process of IP address allocation by dynamically assigning addresses to devices within a network. Unlike static addressing, where IP addresses are manually configured, DHCP automates this process, making it particularly beneficial in environments with a large number of clients. By centralizing IP management through a server, DHCP ensures efficient resource utilization and simplified network administration.


DHCP is use UDP port number 67 for server and 68 for client. DHCP works on DORA process.


DORA

DORA is process that descried how DHCP process works. It's four-part process:

  1. DHCP Discover

  2. DHCP Offer

  3. DHCP Request

  4. DHCP Acknowledge

DORA Process

1. DHCP Discover

At the outset, when a client seeks an IP address, it initiates the DHCP process by broadcasting a discover message across the network. This message, devoid of a specific IP address, aims to discover available DHCP servers.

Source IP: 0.0.0.0
Destination  IP: 255.255.255.255
Source Mac-Address: Client Mac-Address
Destination Mac-Address: FF:FF:FF:FF:FF:FF
Source Port: 68
Destination Port: 67

2. DHCP Offer

Upon receiving the discover message, DHCP servers respond with an offer message, presenting available IP addresses along with server identification. This message, broadcasted at the network layer, aids the client in selecting an appropriate IP address.

Source IP: DHCP Server IP Address
Destination  IP: 255.255.255.255
Source Mac-Address: DHCP-Server Mac-Address
Destination Mac-Address: Client Mac-Address
Source Port: 67
Destination Port: 68

3. DHCP Request

Having received the offer, the client acknowledges the DHCP server by sending a request message, confirming its intent to acquire the offered IP address. This request, transmitted as a unicast message, facilitates the finalization of the IP assignment.

Source IP: 0.0.0.0
Destination  IP: DHCP-Server IP Address
Source Mac-Address: Client Mac-Address
Destination Mac-Address: DHCP-Server Mac-Address
Source Port: 68
Destination Port: 67

4. DHCP Request

Upon receiving the request, the DHCP server completes the process by sending an acknowledgment message, confirming the IP address assignment to the client. This message includes pertinent network configuration information, such as DNS server details and lease duration.

Source IP: DHCP-Server IP Address
Destination  IP: 255.255.255.255
Source Mac-Address: DHCP-Server Mac-Address
Destination Mac-Address: Client Mac-Address
Source Port: 67
Destination Port: 68


DHCP configuration

In this scenario we used Cisco router as a DHCP Server.

Router Configuration:


1. Assign IP address on Interface

Router>enable
Router#configure terminal
Router(config)#hostname DHCP-Server

DHCP-Server(config)#interface gigabitEthernet 0/0
DHCP-Server(config-if)#ip address 192.168.1.1 255.255.255.0
DHCP-Server(config-if)#no shutdown
DHCP-Server(config-if)#exit

2. Create Pool or range of IP so DHCP Server is assign IP from that range and excluded IP for not use for DHCP pool

DHCP-Server(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.50
(excluded address that not assign at client)

DHCP-Server(config)#ip dhcp pool DHCP-POOL           (create DHCP pool)
DHCP-Server(dhcp-config)#network 192.168.1.0 /24 (Assign Network range)
DHCP-Server(dhcp-config)#default-router 192.168.1.1
DHCP-Server(dhcp-config)#dns-server 192.168.1.1
DHCP-Server(dhcp-config)#lease 1
DHCP-Server(dhcp-config)#exit

3. Verification

To check assign IP address and details:


To know about how many pool information details:


To know about DHCP memory usage and DORA message information:



37 views0 comments

Recent Posts

See All

Comments


bottom of page