Skip to content

DHCP Process — Automatically Assigning IP Addresses

Dynamic Host Configuration Protocol (DHCP) is a network protocol that automatically assigns IP addresses and other network configuration information to devices. Instead of manually configuring every computer, server, printer, or mobile device, DHCP provides automatic network configuration, making administration faster, simpler, and less error-prone. Nearly every enterprise, cloud environment, home network, and Wi-Fi network relies on DHCP. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should understand how DHCP works.


Learning Path

Networking Mastery → Module 6: DNS & DHCP → Lesson 4

Difficulty: Beginner

Reading Time: 100 Minutes

Course Progress

Course: Networking Mastery

Module: DNS & DHCP

Lesson: 4 of 7


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand DHCP
  • Learn the DHCP architecture
  • Understand the DORA process
  • Learn DHCP lease management
  • Understand DHCP options
  • Configure DHCP on Linux
  • Troubleshoot DHCP issues

Prerequisites

Complete:


Why Learn DHCP?

Imagine a company with:

  • 2,000 Employees
  • 1,500 Laptops
  • 500 Servers
  • 1,000 Mobile Devices

Without DHCP:

Configure Every Device

Manually

❌ Impossible

Instead:

Connect Device


Receive IP Automatically

What is DHCP?

Dynamic Host Configuration Protocol (DHCP) automatically assigns network configuration to clients.

Typical information includes:

  • IP Address
  • Subnet Mask
  • Default Gateway
  • Domain Name System (DNS) Servers
  • Lease Time
  • Domain Name
  • Additional Network Options

Why Use DHCP?

Benefits include:

  • Automatic IP Assignment
  • Centralised Management
  • Reduced Configuration Errors
  • Faster Device Deployment
  • Efficient IP Address Utilisation
  • Simplified Administration

DHCP Components

A DHCP environment consists of:

  • DHCP Client
  • DHCP Server
  • DHCP Scope
  • DHCP Lease

DHCP Client

A DHCP Client is any device requesting network configuration.

Examples:

  • Laptop
  • Desktop
  • Mobile Phone
  • Server
  • Printer
  • Internet of Things (IoT) Device

DHCP Server

The DHCP Server manages IP address allocation.

Responsibilities:

  • Assign IP Addresses
  • Track Leases
  • Prevent Duplicate Addresses
  • Renew Leases
  • Release Expired Addresses

DHCP Scope

A Scope (or Pool) defines the range of addresses available for assignment.

Example:

192.168.10.100


192.168.10.200

Only addresses within this range are assigned.


DHCP Lease

A DHCP lease is a temporary assignment of an IP address.

Example:

IP Address

192.168.10.120

Lease Time

24 Hours

When the lease expires, the client renews it or obtains a new address.


The DORA Process

DHCP uses a four-step process known as:

DORA

Which stands for:

  • Discover
  • Offer
  • Request
  • Acknowledgment

Step 1 — DHCP Discover

The client has:

No IP Address

It broadcasts:

DHCP Discover

Meaning:

Is There

A DHCP Server?

Step 2 — DHCP Offer

The DHCP Server replies:

DHCP Offer

Example:

IP Address

192.168.10.101

The server offers available network configuration.


Step 3 — DHCP Request

The client responds:

DHCP Request

Meaning:

I Want

192.168.10.101

If multiple servers respond, the client selects one offer and requests that address.


Step 4 — DHCP Acknowledgment (ACK)

The server confirms:

DHCP ACK

The client receives:

  • IP Address
  • Subnet Mask
  • Gateway
  • DNS Servers
  • Lease Time

The device can now communicate on the network.


DORA Workflow

Client


DHCP Discover


Server


DHCP Offer


Client


DHCP Request


Server


DHCP ACK

DHCP Packet Flow

Device Boots


Broadcast Discover


Receive Offer


Request Address


Receive ACK


Network Ready

DHCP Lease Lifecycle

Example:

Lease Granted


Client Uses Address


Lease Renewal


Lease Extended

If renewal fails and the lease expires:

Lease Expires


Restart DORA Process

Lease Renewal

Clients attempt to renew leases before expiration.

Typical process:

50% Lease Time


Renew


Continue Using IP

If renewal fails, additional attempts occur before the lease expires.


DHCP Options

DHCP can provide more than just an IP address.

Common options include:

  • Default Gateway
  • DNS Servers
  • Domain Name
  • Network Time Protocol (NTP) Servers
  • Boot Server
  • Preboot Execution Environment (PXE) Boot Information
  • Static Routes

DHCP Reservation

Some devices should always receive the same IP address.

Examples:

  • Printers
  • Servers
  • Firewalls
  • Network Appliances

DHCP Reservation maps:

Media Access Control (MAC) Address


Fixed IP Address

DHCP vs Static IP

DHCP Static IP
Automatic Manual
Easy Management Manual Configuration
Dynamic Assignment Permanent Address
Ideal for Clients Ideal for Infrastructure

Enterprise Example

Employee Laptop:

Power On


DHCP


IP Assigned


Access Network

No manual configuration is required.


Cloud Perspective

Cloud providers use DHCP to automatically configure:

  • Virtual Machines
  • Virtual Network Interfaces
  • Containers
  • Managed Services

Instances receive:

  • Private IP
  • Gateway
  • DNS Configuration

automatically during startup.


Kubernetes Perspective

Kubernetes nodes typically receive IP addresses from the underlying infrastructure using DHCP or cloud networking.

Pods themselves usually receive IP addresses from the Container Network Interface (CNI) rather than directly from DHCP.


Linux Perspective

Display IP configuration.

ip addr

Display routing table.

ip route

Request a DHCP lease (client).

sudo dhclient

Release current lease.

sudo dhclient -r

View DNS configuration.

cat /etc/resolv.conf

DHCP Example

Network:

Laptop


Switch


DHCP Server


Gateway


Internet

The laptop receives:

  • IP Address
  • Gateway
  • DNS Server

within seconds.


Advantages of DHCP

  • Automatic Configuration
  • Centralised Administration
  • Reduced Errors
  • Efficient Address Allocation
  • Faster Device Deployment
  • Simplified Network Management

Limitations

  • DHCP server failure can prevent new clients from obtaining addresses
  • Misconfigured scopes can cause address exhaustion
  • Rogue DHCP servers can assign incorrect network settings
  • Critical infrastructure often requires static addressing or reservations

Hands-on Lab

Task 1

Display your IP configuration.

ip addr

Task 2

Display routing information.

ip route

Task 3

Release the current DHCP lease.

sudo dhclient -r

Task 4

Request a new DHCP lease.

sudo dhclient

Task 5

View configured DNS servers.

cat /etc/resolv.conf

Task 6

Draw the DORA process.

Include:

  • Client
  • DHCP Server
  • Discover
  • Offer
  • Request
  • ACK

Task 7

Compare:

  • DHCP
  • Static IP Addressing

Task 8

Design a DHCP scope for:

  • 500 Employee Devices
  • 50 Servers
  • 20 Network Printers

Include reserved addresses for infrastructure.


Linux Commands

Command Purpose
ip addr Display IP configuration
ip route Display routing table
dhclient Request DHCP lease
dhclient -r Release DHCP lease
cat /etc/resolv.conf View DNS configuration

Common Mistakes

❌ Mixing DHCP and static addresses in the same allocation range.

✅ Reserve a separate range for static addresses.


❌ Forgetting DHCP reservations for infrastructure.

✅ Use reservations for printers, servers, and network devices.


❌ Creating a DHCP scope that is too small.

✅ Plan capacity with future growth in mind.


❌ Ignoring lease duration.

✅ Choose lease times appropriate for the network environment.


❌ Not securing the network against rogue DHCP servers.

✅ Enable DHCP Snooping on managed switches where supported.


Best Practices

  • Keep infrastructure devices on static IPs or DHCP reservations.
  • Use appropriately sized DHCP scopes.
  • Configure redundant DHCP servers where supported.
  • Monitor lease utilisation regularly.
  • Protect networks with DHCP Snooping.
  • Document scopes, exclusions, and reservations.

Interview Questions

Beginner

  1. What is DHCP?
  2. What is the purpose of DHCP?
  3. What does DORA stand for?
  4. What is a DHCP lease?

Intermediate

  1. Explain the DORA process.
  2. What is a DHCP scope?
  3. What is a DHCP reservation?
  4. How does lease renewal work?

Architect Level

  1. Design a highly available DHCP architecture for a large enterprise.
  2. How would you prevent rogue DHCP servers?
  3. How would you troubleshoot clients that fail to obtain an IP address?

Summary

In this lesson, you learned:

  • DHCP fundamentals
  • DHCP Components
  • DHCP Scope
  • DHCP Lease
  • DORA Process
  • Lease Renewal
  • DHCP Options
  • DHCP Reservations
  • Linux DHCP Commands
  • Enterprise DHCP Design

DHCP automates IP address assignment and network configuration, allowing devices to join networks with minimal manual effort. Through the DORA process, DHCP efficiently provides addresses, gateways, DNS servers, and other essential settings, making it a cornerstone of modern enterprise, cloud, and campus networking.


Key Takeaways

  • DHCP automatically assigns IP addresses and network settings.
  • The DORA process consists of Discover, Offer, Request, and Acknowledgment.
  • DHCP leases are temporary and can be renewed.
  • DHCP options provide additional configuration such as DNS and default gateway.
  • Reservations provide consistent IP addresses for critical devices.
  • DHCP significantly reduces administrative effort and configuration errors.

What's Next?

DHCP Relay

In the next lesson, you'll learn about DHCP Relay.

You'll explore:

  • What DHCP Relay is
  • Why DHCP Relay is needed
  • Broadcast limitations
  • Relay Agents
  • DHCP Relay workflow
  • Enterprise network design
  • DHCP troubleshooting

By the end of the lesson, you'll understand how DHCP requests can cross subnet boundaries, allowing centralised DHCP servers to serve multiple networks efficiently.