How to Install DHCP Server on Cent OS


In this tutorial, you will learn how to install DHCP service on your Cent OS server. DHCP is the Dynamic Host Configuration Protocol that is a service that can manage and deliver IP addresses for your network.

Installing DHCP Service

To install DHCP service, you need to type the following command:

# yum install dhcp

Configuring a Basic DHCP Configuration


Configuration Setting that will use through this document:

  • IP Range: – /16
  • DNS Server:,
  • Default Gateway:
  • Length of the lease:
    • 600s => PCs > IPs
    • 259200s (3 days) => IPs >PCs
    • 43200s (12h) => Recommendation
  • WINS Server:
  • Domain Name: titdara.internal

To archive above configuration, you need to create or update text file /etc/dhcpd.conf as below:

# vi /etc/dhcpd.conf
ddns-update-style interim; Top of the file
ignore client-updates;
subnet netmask {
option routers; Default Gateway
option subnet-mask;
option domain-name “titdara.internal”;
option domain-name-servers,;
option time-offset -18000;
option netbios-name-servers; WINS Server
range dynamic-bootp; Range to be assign
default-lease-time 43200;
max-lease-time 86400;

If we have more than one network interface we need to specify which interface work DHCP server:

# vi /etc/sysconfig/dhcpd

Checklists after everything done:
Network Interface must have IP Configuration (
Set DHCP as Startup service

# chkconfig –level 2345 dhcpd on
# chkconfig –level 016 dhcpd off

Make sure it work:

# chkconfig –list
dhcpd dhcpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Start dhcpd service

# /etc/init.d/dhcpd start

Related Articles

Comments ()


February 02, 2016

03:55 pm


By Tithdara


Latest Articles