DHCP Server and Client

What is a DHCP Server?

A DHCP Server (Dynamic Host Configuration Protocol Server) is a network device or software service that automatically assigns IP addresses and other network configurations to devices (clients) on a network. It eliminates the need for manual IP configuration, ensuring efficient IP address management and preventing conflicts.

Functions of a DHCP Server:

  • IP Address Allocation: Assigns dynamic, static, or automatic IP addresses.
  • Network Configuration Distribution: Provides essential settings like subnet mask, default gateway, and DNS server addresses.
  • Lease Management: Monitors IP address leases and renews or reclaims them as needed.
  • Prevents IP Conflicts: Ensures that each device receives a unique IP address.

How a DHCP Server Works?

  1. Listens for client requests on UDP Port 67.
  2. Processes DHCP Discover messages from clients searching for an IP address.
  3. Sends DHCP Offers with available IP addresses and configurations.
  4. Confirms IP assignment after the client accepts the offer.
  5. Manages leases, renewals, and reclaims expired IP addresses.

What is a DHCP Client?

A DHCP Client is any device (computer, phone, IoT device, etc.) that requests and receives an IP address from a DHCP server. It automates the process of obtaining network configuration, allowing the device to connect to a network without manual setup.

Functions of a DHCP Client:

  • Automatically requests an IP address when connecting to a network.
  • Communicates with the DHCP server using the DORA process (Discover, Offer, Request, Acknowledge).
  • Monitors lease time and renews its IP address when necessary.
  • Releases IP addresses when disconnecting from the network.

How a DHCP Client Works?

  1. Broadcasts a DHCP Discover message to locate an available DHCP server (UDP Port 68).
  2. Receives a DHCP Offer with an available IP address and network settings.
  3. Sends a DHCP Request to confirm the IP assignment.
  4. Receives DHCP Acknowledge (ACK) confirming the lease.
  5. Uses the assigned IP for communication on the network.

DHCP Server vs. DHCP Client – Key Differences

FeatureDHCP ServerDHCP Client
RoleAssigns IP addresses and network settingsRequests and receives an IP address
FunctionManages and distributes network configurationsUses assigned IP to communicate on the network
Communication PortListens on UDP Port 67Sends requests on UDP Port 68
ConfigurationManually set up by network administratorsAutomatically obtains settings
Example DevicesRouters, network serversPCs, smartphones, printers, IoT devices

Types of DHCP Server Implementations

1. Hardware-Based DHCP Servers:

  • Dedicated network appliances (routers, firewalls) with built-in DHCP services.
  • Used in large-scale enterprise networks.

2. Software-Based DHCP Servers:

  • Run on Windows, Linux, or cloud-based platforms.
  • Examples: Microsoft DHCP Server, ISC DHCP Server (Linux), Cisco IOS DHCP.

3. Cloud-Based DHCP Servers:

  • Hosted DHCP services managed by cloud providers.
  • Examples: AWS DHCP, Google Cloud DHCP.

Configuring a DHCP Server (Windows/Linux Example)

1. Configuring a DHCP Server on Windows Server:

  1. Install DHCP Role via Windows Server Manager.
  2. Open DHCP Manager and configure a new scope (IP range).
  3. Set subnet mask, lease duration, and DNS settings.
  4. Authorize the server in Active Directory.
  5. Start the DHCP service.

2. Configuring a DHCP Server on Linux (ISC DHCP Server Example):

  1. Install the DHCP package:

sudo apt update && sudo apt install isc-dhcp-server

2. Edit the DHCP configuration file (/etc/dhcp/dhcpd.conf):

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option domain-name-servers 8.8.8.8, 8.8.4.4;
default-lease-time 600;
max-lease-time 7200;
}

3. Restart the DHCP service:

sudo systemctl restart isc-dhcp-server

Common DHCP Issues and Troubleshooting

IssuePossible CauseSolution
Clients not receiving an IP addressDHCP server is offlineRestart the server and check logs
IP conflictsOverlapping static and dynamic IPsUse IP reservation for critical devices
DHCP lease expiration issuesShort lease timeExtend lease duration
Unauthorized devices getting IPsRogue DHCP serversEnable DHCP Snooping & MAC Filtering

Security Measures for DHCP Servers

🔒 Enable DHCP Snooping – Prevents rogue DHCP servers from issuing addresses.
🔒 MAC Address Filtering – Allows only authorized devices to obtain IPs.
🔒 Static IP Reservations – Ensures critical devices always get the same IP.
🔒 Implement Authentication – Restricts DHCP server access to trusted clients.


Conclusion

A DHCP Server and Client work together to simplify network management by automating IP allocation. The DHCP server dynamically assigns IP addresses and network settings, while the client automatically configures itself to use the assigned parameters. Implementing proper security measures ensures reliable and secure DHCP operations within a network.

Leave a Reply

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