Dynamic Host Configuration Protocol (DHCP) is used to assign IP addresses and other stuff like gateway and DNS details automatically to the clients. we need a DHCP server configured for offering ipaddress to the clients when it is required.

Installing DHCP Server on CentOS 6

Make sure that you had installed CentOS 6 and configured network before.

Update yum repositories and packages by typing the below command

[root@localhost ~]# yum update

Install dhcp server and client using the below command

[root@localhost ~]# yum install dhcp

Configuring DHCP Server on CentOS 6

After installing dhcp server packages along with dependencies .Assign a static ip (eg: “″) in the same DHCP range for the listening interface ( eg : “eth0″ ). Open /etc/sysconfig/network-scripts/ifcfg-eth0 file and make the changes as per your requirement.


Now open /etc/sysconfig/dhcpd file and add the preferred interface name to DHCPDARGS variable as below

# Command line options here

Open /etc/dhcp/dhcpd.conf file and paste the below lines and save it.

#specify domain name
option domain-name “chaulv8x.com”;
#specify DNS server ip and additional DNS server ip
option domain-name-servers,;
#specify default lease time
default-lease-time 600;
#specify Max lease time
max-lease-time 7200;
#specify log method
log-facility local7;
#Configuring subnet and iprange
subnet netmask {
option broadcast-address;
#Default gateway ip
option routers;
#Fixed ip address based on MAC id
host Printer01 {
hardware ethernet 02:34:37:24:c0:a5;

Now start the service

[root@localhost ~]# service dhcpd start

and type this below command to start dhcp service automatically while booting.

[root@localhost ~]# chkconfig –levels 235 dhcpd on

That’s it .Clients can get IP from DHCP server and Please ensure you don’t have any other dhcp servers in the same network ( Routers might have DHCP enabled ).

*NOTE: Domain “chaulv8x.com” in this tutorial is just example, you can replace with your domain.