Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

WhatsApp 9821215002

Blog Student Reviews

Home » Blog » What is DHCP? Its Relay Agent, DORA Process and Server Configuration
Explained!

Skip to Main
CCNP Encor Routing Switching | Cisco Certifications | Network Training
WhatsApp 9821215002

What is DHCP? Its Relay Agent, DORA


Blog Student Reviews

Process and Server Configuration


Explained!
Author : Saraswati

Last Modified: April 27, 2023

DHCP stands for Dynamic Host Configuration Protocol. It is an extremely useful protocol as,
without it, it becomes necessary to manually assign IP addresses for new computers and
computers that are transferred from one subnet to another. So, let’s learn what is DHCP
and what are DHCP Relay agents, and what DHCP DORA Process is.

Do you know that to connect to a TCP/IP-based network and use its resources, each
device needs a distinct unicast IP address?

The DHCP protocol automatically provides this unicast IP address to each device.

To learn DHCP in detail, you should join CCNA Training.

Table
Skip of Contents
to Main
1. What is DHCP?
2. DHCP DORA Process
2.1. 1. Discover
2.2. 2. Offer
2.3. 3. Request
WhatsApp 9821215002
2.4. 4. Acknowledge Blog Student Reviews
2.5. Important DHCP Terms
2.6. DHCP Server Deployment:
3. DHCP Relay Agent

What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is an application layer protocol that allows a
server to dynamically assign IP addresses & more information to hosts connected to LAN.

IP Address
Subnet Mask
Default-Gateway
DNS-Server

DHCP is based on a client-server model and works on the discovery, offer, request, and
Acknowledgement. DHCP uses the port number for:

DHCP Server uses Port No. 68


DHCP Client uses Port No. 67

It employs UDP services and is a client-server protocol, and a pool of addresses is used to
assign IP addresses. In DHCP, the client and the server exchange mainly 4 DHCP messages
in order to make a connection, also called the DHCP DORA process.

Skip to Main
DHCP DORA ProcessWhatsApp 9821215002
Blog Student
DORA stands for Discover, Offer, Request, Reviews
Acknowledge. DHCP uses Dora Process to provide
an IP Address to hosts or client machines. It collects all of the IP addresses from the central
server that are accessible and gives them to hosts that want to connect to the network.

1. Discover
When you select the option “Obtain IP automatically,” it means that a DHCP client is
requesting IP to the DHCP server, and this discover request is sent out in the form of a
broadcast request using 255.255.255.255 This request will reach every device in the
network including DHCP server too.

Header info of discovery message –

Source IP address: 0.0.0.0


Destination IP address: 255.255.255.255
Source MAC address: MAC address of DHCP clients
Destination MAC address: FF:FF:FF:FF:FF:FF

2. Offer
Once the DHCP accepts the discover request sent by the client. The DHCP will offer some IP
to the client.
Skip to Main

Header info of offer message –


Source IP address: IP of DHCP Server Destination
WhatsApp 9821215002
IP address: 255.255.255.255
Blog Student Reviews
Source MAC address: DHCP Server’s MAC address
Destination MAC address: MAC add of DHCP clients

3. Request
The client will select the IP address accordingly and request to the DHCP server that “I want
to use this IP”. So, the client will send a request to use the specific selected IP.

Header info of request message –

Source IP address: 0.0.0.0


Destination IP address: 255.255.255.255
Source MAC address: MAC add of DHCP clients
Destination MAC address: MAC add of DHCP server

4. Acknowledge
The DHCP server will receive the request sent by the client machine and then acknowledge
the requested IP.

Header info of acknowledge message –

Source IP address: IP Address of DHCP Server


Destination IP address: 255.255.255.255
Source MAC address: MAC address of DHCP server
Destination MAC address: MAC add of DHCP clients

Discover Via Client using port no. 67

Offer Via server using port no. 68

Request Via Client using port no. 67

Acknowledge Via server using port no. 68

Important DHCP Terms


Skip to Main
Scope – all the IP Addresses which DHCP provides comes under the scope.
Lease – for how much time your DHCP will lease the IP to the client.
Exclusion – to exclude IP Addresses.
Reservation – to reserve IP Addresses for the machine.
WhatsApp 9821215002
Blog Student Reviews
DHCP Server Deployment:
We can deploy the DHCP server in two ways:

Centralized – Single DHCP for all networks (For this, we need to configure DHCP Relay
Agent).
Decentralized – Separate DHCP for every network.

Because whenever we configure multiple DHCP servers on one router, we have to make
another router act as DHCP Relay Agent. This is only possible in the centralized deployment
of DHCP because in decentralized, you always have to configure separate DHCPs for
separate networks or routers.

DHCP Relay Agent


A host or router that relays DHCP packets between clients and servers is known as a DHCP
relay agent. The SD-WAN equipment’ DHCP Relay feature allows network managers to
relay communications between nearby DHCP Clients and a distant DHCP Server.

Local hosts can obtain dynamic IP addresses from the distant DHCP Server thanks to it.
After receiving DHCP messages, the relay agent creates a fresh message to broadcast on
a different interface.

Skip
When to Main
creating a DHCP relay agent, you must let the R-2 know the IP of the DHCP server.
You can tell any IP (R-1 or R-2) 10.0.0.1 or 10.0.0.2

So, then the router won’t broadcast. It’ll unicast to the LAN 192.168.2.1
WhatsApp 9821215002
And this is how it’ll unicast,
Blog Student Reviews

Source IP Source Port Port No. 68

Destination IP Destination Port Port No. 67

Like this –

192.168.2.1 68 10.0.0.1 67

Source IP Source Port Destination IP Destination Port

Let’s configure DHCP Lab as per the given diagram.

Open R-1 & follow these commands –

Step 1: First, provide the IP Address to interface Fa0/1 – 192.168.1.1

R1(config)#interface fa0/1

Skip to Main
R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config-if)#No shutdown
Step 2: Let’s configure DHCP on R-1.WhatsApp 9821215002
Blog Student Reviews
R1(config)#Service DHCP (To enable DHCP Service if it’s disabled)

R1(config)#IP DHCP POOL PYNETLABS

R1(dhcp-config)#NETWORK 192.168.1.0 255.255.255.0

R1(dhcp-config)#DEFAULT-ROUTER 192.168.1.100

R1(dhcp-config)#DNS-SERVER 8.8.8.8

R1(dhcp-config)#DOMAIN-NAME PYNET.COM

R1(dhcp-config)#EXIT

R1(config)#IP DHCP EXCLUDED-ADDRESS 192.168.1.2 192.168.1.5

IP DHCP EXCLUDED ADDRESS – It refers to the exclusion on IP, which we don’t want.

SERVICE DHCP – It’s only used when DHCP Service is not enabled.

Now, let’s verify DHCP with our connected nodes.

Skip to Main
No IP has been assigned yet, so type DHCP on the node as we use GNS for this lab in packet
WhatsApp 9821215002
tracer. You can directly click on obtain IP automatically.
Blog Student Reviews

As we write DHCP & Press, enter DORA process will run, and these are the results we got.

To Verify DHCP on R-1, use these commands:

R1#Show ip dhcp pool

R1#show ip dhcp binding

Skip to Main
If you want to renew IP on the host machine –
WhatsApp 9821215002
Blog Student Reviews
PC- 1#ipconfig /release

PC- 1#ipconfig /renew

Now, we’ll assign IP to FA0/0 as 10.0.0.1 & 10.0.0.2 and then we’ll do static routing in both
routers.

R1(config)#interface fa0/0

R1(config-if)#ip address 10.0.0.1 255.0.0.0

R1(config-if)#no shutdown

R1(config-if)#exit

R1(config)#ip route 192.168.2.0 255.255.255.0 11.0.0.2 (Static Routing)

Assign the same on R-2 now. Just configure only IP Addresses as of now.

Skip to Main terminal


R2#configure

R2(config)#interface fa0/0
R2(config-if)#ip address 10.0.0.2 255.0.0.0
WhatsApp 9821215002
Blog Student Reviews
R2(config-if)#no shutdown R2(config-if)#exit

R2(config)#interface fa0/1

R2(config-if)#ip address 192.168.2.1 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1 (Static route for R1)

Now what we must understand is that to assign IPs on Network 192.168.2.0 we have to
create a DHCP Relay Agent.

So, now we must again go on R-1 and configure DHCP for R-2.

Let’s configure DHCP on R-1

R1(config)#Service DHCP (To enable DHCP Service if it’s disabled)

R1(config)#IP DHCP POOL PYNETLABS 1

R1(dhcp-config)#NETWORK 192.168.2.0 255.255.255.0

R1(dhcp-config)#DEFAULT-ROUTER 192.168.2.100

R1(dhcp-config)#DNS-SERVER 8.8.8.8

R1(dhcp-config)#DOMAIN-NAME PYNETLABS.COM

R1(dhcp-config)#EXIT

R1(config)#IP DHCP EXCLUDED-ADDRESS 192.168.2.2 192.168.2.5


Skip to Main
WhatsApp 9821215002
Blog Student Reviews

Now, let’s make R-2 the DHCP Relay-Agent.

R2(config)#int fa0/1

R2(config-if)#ip helper-address 10.0.0.1

And we are done here, so that’s what is known as your DHCP Relay Agent as a centralized
server deployment.

And now you can see the R-2 is getting the DHCP IP Addresses from the R-1, and that’s
what the concept of Relay Agent is.

If you are still with us, we are sure you have understood everything about DHCP and how it
works. We hope you like it; please share your valuable feedback in the comment box
below. If you like this blog, it would be better to subscribe to our free newsletter to never
miss out on any new blogs. To help you understand DHCP better, here is the video for you
to watch.

You may also like –

UDP vs TCP

DHCP with IPv6


Skip to Main
WhatsApp 9821215002
Here are some FAQs related to DHCP:
Blog Student Reviews

Question 1 – What is DHCP and why it is used?

Answer – DHCP (Dynamic Host Configuration Protocol) is an application layer protocol


that allows a server to dynamically assign IP addresses & more information to hosts
connected to LAN. It is used to acquire configuration information like DNS Server Addresses,
IP Addresses, and a default route.

Question 2 – What does DHCP and DNS do?

Answer – When a device connects to a network, the Dynamic Host Configuration Protocol
(DHCP) automatically assigns IP addresses and other parameters to the device. In
contrast, an Internet service called the Domain Name System (DNS) converts domain
names into IP addresses.

Question 3 – Is DHCP same as IP address?

Answer – IP Address is a combination of numbers used to verify each device connected to


the network. In contrast, a DHCP is used to assign IP addresses to various devices joining
the network automatically.

Question 4 – What are the 4 steps of DHCP?

Answer – DHCP works on the DORA Process, so the 4 steps of DHCP are: Discover, Offer,
Request, and Acknowledge. It gathers all the available IP Addresses from the centralized
server and provides those to hosts who want to connect to the network.

You may also like – Hashing vs Encryption

Enquiry Form
Name *

Skip to Main
Name

Email *
Email Address WhatsApp 9821215002
Blog Student Reviews
Mobile *

Mobile Number

Country

Select Country

Submit Form

Category List
Advance Cisco SD-WAN

CCNA 200-301

CCNA DevNet

CCNA Self Paced

CCNP DevNet

CCNP Encor Routing Switching

Cisco Certifications

Cisco DEVIOT 300-915

Cisco Enarsi 300-410

Cisco Lab Rental

Cisco Nexus DC ACI

Cisco SD WAN

Cisco SD-WAN Lab Rental

Corporate Training

Devcor 350-901
Skip to Main
Encor Self Paced

Job Openings for Network Engineers in India


Network Automation
WhatsApp 9821215002
Network Engineer Blog Student Reviews

Network Engineer Salary

Network Training

Python

Skip to Main
WhatsApp 9821215002
Blog Student Reviews

Skip to Main
WhatsApp 9821215002
Blog Student Reviews

Recent Blog Post

Different Types of WANs OSI Model Interview Questions and


Answers

How Does Packet Flow in Network? What is PIM Protocol?

Leave a Reply
Your email address will not be published. Required fields are marked *

Comment *

Skip to Main
Name *
WhatsApp 9821215002
Blog Student Reviews

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

Post Comment

About Us Contact Us

India: +919821215002

USA: +13322329818

PyNet Labs is a corporate training company Email: hello@pynetlabs.com


headquartered in Gurugram, India, serving
corporations across the globe with ever- Join PyNet Labs Telegram
changing IT trainings. Channel
PyNet Labs' Official Channel

Network Engineer Job Channel

PyNet Learning Channel

Popular Courses Quicklinks

Cisco SD-WAN
Skip to Main Training About Us

Python + CCNA DevNet Training Contact Us


100% Job Guarantee Program Blogs
WhatsApp 9821215002
CCNA Training Blog Student Reviews
PyNet Labs Reviews

CCNP ENCOR Training Free Webinars

Versa SD-WAN Training Corporate Training

CCNP DevNet Training Interview Questions

Lab Rental

Terms and Conditions

Copyright © 2023 PyNet Labs Private Limited


Privacy Policy

You might also like