top of page
  • Writer's pictureRomit Kakadiya

DHCP (Dynamic Host Configuration Protocol)

Updated: Nov 9, 2022


DHCP Overview


- IP Address is most important thing in networking. IP address is logical address based on that network devices is communicate. You can assign IP address static or dynamic.

- Static address is mostly used for configuring routers, switches, server other network devices. But consider if you have large number of client and assign to IP address using static method is not worth that. so, concept is to assign dynamic IP for devices and that IP is maintain by server.

- DHCP is protocol that assign IP dynamically for devices. 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

This is first step of process. When client want to IP address from DHCP Server initially send discover message. This discover message is broadcast message in network and data-link layer.

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

- After receiving discover message DHCP Server send Offer message. In this message contain I am DHCP Server, and this is my IP address and send me to about IP address information.

- This is network layer broadcast because of client can't have IP address and unicast in data-link layer.

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

After receiving offer message Client know about DHCP Server IP and Mac-Address. After that client send request message for DHCP Server to send me IP address information. This is Unicast on both network and data-link layer.

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

After receiving Request message DHCP Server send Acknowledge message that contain IP address from pool of network, DNS Server, Default router IP and leased time for IP and more information. This is network layer broadcast because of client can't have IP address and unicast in data-link layer.

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:



32 views0 comments

Recent Posts

See All
bottom of page