bgunderlay bgunderlay bgunderlay

How to Configure a DHCP Server on Linux/Windows

Setting up a DHCP (Dynamic Host Configuration Protocol) server is an essential task for network administrators, as it automates the assignment of IP addresses to devices on a network. Whether you’re running a Linux or Windows environment, configuring a DHCP server allows you to manage IP address distribution efficiently, ensuring that devices can connect to the network seamlessly.

What is a DHCP Server?

A DHCP server automatically assigns IP addresses and other network configuration settings (like subnet mask, default gateway, and DNS servers) to devices on a network. This eliminates the need for manual IP configuration and reduces the chances of IP conflicts.

Configuring a DHCP Server on Linux

Linux systems commonly use the ISC DHCP server, which is an open-source and widely used DHCP server. Here’s how to set it up and configure it on a Linux system.

Step 1: Install the DHCP Server Package

Before configuring the DHCP server, you need to install the DHCP package. This can be done using your Linux distribution’s package manager.

For Ubuntu/Debian:

sudo apt update

sudo apt install isc-dhcp-server

For CentOS/RHEL:

sudo yum install dhcp

Step 2: Configure the DHCP Server

Once the DHCP server is installed, the configuration file is usually located at /etc/dhcp/dhcpd.conf. You will need to edit this file to define the DHCP server settings, including the IP address range, subnet mask, and other parameters.

Here’s an example configuration:

# /etc/dhcp/dhcpd.conf

# Define the default lease time

default-lease-time 600;

# Define the maximum lease time

max-lease-time 7200;

# Define the subnet and the IP range to assign

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 subnet-mask 255.255.255.0;

  option domain-name-servers 8.8.8.8, 8.8.4.4;

  option domain-name “example.com”;

}

  • default-lease-time: Specifies the default duration (in seconds) that an IP address is leased to a client.
  • max-lease-time: The maximum time a client can hold an IP address lease.
  • range: Defines the pool of IP addresses that the DHCP server can assign to clients.
  • option routers: Specifies the default gateway.
  • option domain-name-servers: Specifies the DNS servers to be used by the client.

Step 3: Set the Network Interface

You need to define the network interface where the DHCP server will listen for requests. This setting is in the /etc/default/isc-dhcp-server file on Ubuntu/Debian or /etc/sysconfig/dhcpd on CentOS/RHEL. Specify the interface, like this:

For Ubuntu:

INTERFACESv4=”eth0″

For CentOS:

DHCPDARGS=”eth0″

Step 4: Start and Enable the DHCP Service

Once you’ve configured the server, start the DHCP service and enable it to run at boot.

For Ubuntu/Debian:

sudo systemctl start isc-dhcp-server

sudo systemctl enable isc-dhcp-server

For CentOS/RHEL:

sudo systemctl start dhcpd

sudo systemctl enable dhcpd

Step 5: Verify the Configuration

To ensure the DHCP server is running correctly, check the status of the service:

sudo systemctl status isc-dhcp-server  # Ubuntu/Debian

sudo systemctl status dhcpd            # CentOS/RHEL

Additionally, review the logs located in /var/log/syslog (Ubuntu) or /var/log/messages (CentOS) to troubleshoot any issues.

Configuring a DHCP Server on Windows

Windows Server operating systems come with a built-in DHCP server role that makes configuration straightforward through a graphical interface.

Step 1: Install the DHCP Server Role

  1. Open Server Manager and click on Manage > Add Roles and Features.
  2. In the Add Roles and Features Wizard, select DHCP Server and proceed through the installation steps.
  3. After installation, open the DHCP Management Console from the Tools menu.

Step 2: Configure the DHCP Server

  1. In the DHCP console, right-click on your server name and choose New Scope.
  2. Follow the wizard to create a new IP scope:
    • Scope Name: Provide a name for the scope.
    • IP Address Range: Define the range of IP addresses to be leased (e.g., 192.168.1.100 – 192.168.1.200).
    • Subnet Mask: Specify the subnet mask (e.g., 255.255.255.0).
    • Lease Duration: Set the lease duration (default is 8 days).
    • Configure Options: Set the default gateway, DNS servers, and domain name as needed.
  3. Complete the scope creation, and it will become active immediately.

Step 3: Authorize the DHCP Server

To prevent unauthorized DHCP servers on the network, Windows requires DHCP servers to be authorized in Active Directory.

  1. Right-click on the server name in the DHCP console and select Authorize.
  2. After authorization, the server will start leasing IP addresses.

Step 4: Configure DHCP Options

You can configure additional options like DNS servers, routers, and custom settings.

  1. In the DHCP Console, expand the scope, right-click on Scope Options, and select Configure Options.
  2. Select options like 003 Router (default gateway), 006 DNS Servers, and 015 DNS Domain Name to configure the network settings provided to clients.

Comparison of DHCP Server Configuration: Linux vs. Windows

FeatureLinux (ISC DHCP)Windows DHCP
Installation MethodPackage installation via terminal (apt/yum)Installed via Server Manager (GUI)
Configuration MethodEditing /etc/dhcp/dhcpd.conf fileConfigured via GUI wizard in DHCP Console
Network Interface SetupManual editing of interface config filesAutomatically binds to selected interfaces
Lease Time and OptionsDefined in dhcpd.conf fileConfigurable through GUI with pre-defined options
Service ManagementManaged via systemctl commandsManaged via DHCP Server service in Windows
Advanced ConfigurationFlexible through text file editingLimited to GUI options and manual option setup
Logging and TroubleshootingLogs located in /var/log/View logs via Event Viewer in Windows

Best Practices for Configuring DHCP Servers

  • Security

Always restrict access to the DHCP server to trusted interfaces. Enable firewall rules to prevent unauthorized access.

  • Backups

Regularly back up your DHCP configuration to prevent data loss in case of system failure.

  • Monitoring

Continuously monitor DHCP server logs to detect issues such as IP conflicts or address pool exhaustion.

  • Scope Size

Ensure that your IP scope is large enough to handle all the devices on your network but not so large that addresses are wasted.

Conclusion

Configuring a DHCP server on both Linux and Windows systems is relatively straightforward, with each platform offering its own tools for easy setup and management. On Linux, the process involves working with configuration files and using the command line, while Windows provides a more user-friendly GUI for DHCP management. Understanding these processes allows network administrators to automate IP address management and improve the efficiency of their networks.

Alexander Timokhin

COO

    Ready to get started?

    Articles
    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses (2026 Update)
    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses (2026 Update)

    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses Subnetting is a critical

    More
    IPv4 Leasing Revolution: Why Smart Businesses Are Ditching Ownership in 2025
    IPv4 Leasing Revolution: Why Smart Businesses Are Ditching Ownership in 2025

    Why IPv4 Leasing Is Becoming the Smart Choice for Businesses in 2025 1. Introduction

    More
    Network Isolation Revolution: IPv4 Marketplace Insights for Enterprise Security
    Network Isolation Revolution: IPv4 Marketplace Insights for Enterprise Security

      As CEO of InterLIR, I’ve witnessed firsthand how network isolation strategies

    More
    What is ASN?
    What is ASN?

    What is an ASN? ASN stands for Autonomous System Number. It is a unique identifier

    More
    How Anycast DNS Actually Works (And Why Your Network Needs It)
    How Anycast DNS Actually Works (And Why Your Network Needs It)

    Anycast DNS: A Leader’s Guide to Protecting Your Digital Infrastructure Executive

    More
    Why RPKI Matters: Securing Your Company’s Internet Traffic
    Why RPKI Matters: Securing Your Company’s Internet Traffic

    RPKI Certification: A Leader’s Guide to Internet Routing Security Executive

    More
    Why RIPE Address Policy Matters for Your Company’s Digital Future
    Why RIPE Address Policy Matters for Your Company’s Digital Future

    Executive Summary: What You Need to Know 🎯 Strategic Importance – Internet

    More
    AWS Outages: The CEO’s Guide to Preventing Downtime & Protecting Revenue
    AWS Outages: The CEO’s Guide to Preventing Downtime & Protecting Revenue

      When AWS DynamoDB failed in October 2025, thousands of businesses discovered that

    More
    What I Wish CEOs Knew About Managing IP Reputation Risk
    What I Wish CEOs Knew About Managing IP Reputation Risk

    Executive Summary: What You Need to Know 🎯 IP reputation directly impacts your

    More
    How to Create a Subnet and Configure Routing
    How to Create a Subnet and Configure Routing

    Mastering Subnetting and Routing for Modern Networks Why Subnetting Matters in Today’s

    More