Week 6 - Lab Instructions - DHCP Configuration
Week 6 - Lab Instructions - DHCP Configuration
Computer
Networks
Products
Lecturer:
Dr. Hamidreza Bagheri
2024-2025
DHCP Configuration on Packet Tracer
Part 1: Background
Dynamic Host Configuration Protocol (DHCP) is a network protocol used to automatically
assign IP addresses and other network configuration parameters to devices including
computers, laptops, smartphones, and printers on a network.
IP addressing is a vital task for network administrators to accomplish, and configuring IP
addresses on computers and network devices can be a challenge especially when the number
of devices is large. Two ways that a computer can assign an IP address are Static IP or
Dynamic IP.
Static IP
The user assigns an IP address manually. This was the original method that was done at the
beginning of the networking. You have a computer network configuration page for each
device and type the IP address manually. In addition to this, you also must enter a subnet
mask, default gateway and DNS server if needed. You do the same every time you incorporate
a new device. It was not feasible with a large number of devices. All the IP addresses should
be unique to avoid IP conflict.
Dynamic IP
The device automatically receives an IP address from a DHCP server. It also features a subnet
mask, default gateway, and DNS server. DHCP enables devices to connect to a network and
obtain all required network information, (IP, subnet mask, default gateway, and DNS server
addresses) automatically from a DHCP server, eliminating the need to manually configure
each device with an IP address.
The DHCP service identifies client nodes by their MAC address and ensures assigned IPv4
addresses are unique. This ensures that devices can communicate effectively without
encountering conflicts in their network settings and making it easier to maintain large
networks.
• DHCP Server: DHCP Server is a server that holds IP Addresses and other information
related to configuration.
• DHCP Client: It is a device that receives configuration information from the server. It can
be a mobile, laptop, computer, or any other electronic device that requires a connection.
• DHCP Relay: DHCP relays basically work as a communication channel between DHCP
Client and Server.
• IP Address Pool: It is the pool or container of IP Addresses possessed by the DHCP Server.
It has a range of addresses that can be allocated to devices.
• Lease: It is simply the time that how long the information received from the server is
valid, in case of expiration of the lease, the tenant must have to re-assign the lease.
1|Page
• Renewal: DHCP clients can request renewing their lease before it expires to ensure that
they continue to have a valid IP address and configuration information.
• Failover: DHCP servers can be configured for failover, where two servers work together
to provide redundancy, and ensure that clients can always obtain an IP address and
configuration information, even if one server goes down.
DHCP Operations
DHCP protocol operates on the application layer of the TCP/IP protocol stack to dynamically
assign IP addresses & configuration information to DHCP clients. In DHCP, the client and the
server exchange mainly four DHCP messages to make a connection. These messages are
abbreviated as DORA (Discover, Offer, Request & Acknowledgement). The figure below
demonstrates the DHCP process between a client and a DHCP server.
1. DHCP discover: At this stage, the client has no IP address and no DHPC server address.
Thus, the client broadcasts a DHCP server request.
2. DHCP offer: The DHCP server receives the discover request. This enables the DHCP server
to respond with an Offer for an IP address back to the client.
3. DHCP request: The client broadcasts a request to lease an address from one of the offering
DHCP servers.
4. DHCP acknowledges: The DHCP server that the client responds to acknowledges the
client, assigns it any configured DHCP options and updates its DHCP database. The client
then initializes and binds its TCP/IP protocol stack and can begin network
communication.
In this lab session, we will discuss these methods for DHCP configuration in Packet Tracer.
2|Page
Part 2: Configure DHCP Service on a Server
In Part 2, we will set up a DHCP service on a server and configure basic settings.
Keep in mind that multiple services, including HTTP, FTP, email, DHCP, and others, may be
offered by a single server.
Open Cisco Packet Tracer, and create the following simple topology:
Before enabling the DHCP service on the server, we must assign the static IP address to the
server to establish connectivity.
PC should be configured to accept IPs from the DHCP server so we will change the IP
configuration from static to DHCP. Click on PC and navigate to Desktop tab and click on IP
Configuration.
3|Page
Choose the DHCP option as indicated in the figure below.
To configure the DHCP service, click on the DHCP tab, turn on the DHCP service, and do the
following configurations.
We can change the Pool Name, if needed. We can set up the default gateway and DNS if
required as per our network design but leave as it is here as illustrated in the figure above.
We define the Start IP Address as well as its Subnet Mask so the server will issue the IP
addressed to devices in our network according to our scope mentioned.
Then, we must define the maximum number of users so the server will not lease IP addresses
to the devices if the limit is reached. In this example, the defined limit is 254, now the server
4|Page
will only release 254 IP addresses even if the mentioned IP range scope has a high number of
IP addresses.
Multiple pools can be added to the server and if any pool is not required then it can be
removed easily. This is very important to be aware of this, as we normally need to configure
a number of Pool for a network with several different IP address ranges. For example, as
shown in the figure below, one extra pool has been added to the server with a different IP
range so now the server has a lot more IPs to assign.
To check the outcome of the DCHP configuration, we can see the PC IP configuration once
again. As shown in the image below, the PC has been assigned an IP address successfully by
the DHCP server. An assigned IP address is from the configured scope on the server.
5|Page
Part 3: Configure the router as a DHCP server
In this part, we will configure the router as a DHCP server in the following packet tracer lab.
Create the following topology:
We will set up the same parameters on the router (Router 1) as we did on the server above.
However, we must use the router’s command-line interface to set up the routers with DHCP
capabilities.
We will configure DHCP on the Cisco router with 4 easy steps.
Step 1: Creating a pool and naming the pool.
In this part, we will set the name “Dynamic” to the DHCP pool by the following command:
Step 2: Defining the ranges of the addresses that the router will lease to the clients.
Router(config)#service dhcp
We can again see that the PC has received the IP address from the router so now the router
is acting as a DHCP server, as shown in the figure below.
6|Page
Note that DHCP server and DHCP client should be in the same VLAN to be able to
communicate as the initial DHCP discover is a layer 2 broadcast packet
to ff:ff:ff:ff:ff:ff MAC address. Cisco routers and layer 3 switches can act as DHCP
relay and forward DHCP requests to a DHCP server located in another VLAN a single DHCP
server can now be deployed to deliver IP addresses to many subnets.
1. PC PC 5
2. Switch PT-Switch 2
3. Router PT-Router 1
4. Server Server-PT 1
Now create a network topology as shown below the image. Use an Automatic connecting
cable to connect the devices with others.
7|Page
Step 1: Server Configuration
• Then, go to desktop and IP configuration and there you will find IPv4 configuration.
• Add IPv4 address, subnet mask, and Default Gateway.
Configure the Server with IPv4 address, Subnet Mask, and Default Gateway according to the
data given in the table below.
Default-Gateway 172.168.10.1
8|Page
Step 2: Assigning an IP address using the ipconfig command.
We can also assign an IP address with the help of a command. Go to the command prompt of
the server. Then, enter the following command.
9|Page
Step 3: Configuring the DHCP server.
10 | P a g e
11 | P a g e
Step 4: Configuring Router
To configure the Router (Router-PT), use the data on the IP addresses given in the table
below.
To ensure that PCs in the green area receive IP from the DHCP server, click on Router0, and
choose the FastEthernet1/0, and enter the following command on CLI tab:
ip helper-address 172.168.10.2
12 | P a g e
Repeat this procedure for other PCs to configure them thoroughly.
13 | P a g e