how to configure dhcp server in linux step by step

how to configure dhcp server in linux step by step

Question : how to configure dhcp server  in linux ?

Question : step by step setting Dynamic Host Configuration Protocol in centos ?

DHCP :- Dynamic Host Configuration Protocol

IP -

Hostname -

OS - CentOS 6

PORT - 68

DHCP (Dynamic Host Configuration Protocol) is a network protocol used for assigning IP address to network clients dynamically from predefined IP pool. It is useful for LAN network, but not generally used for production servers.
Step -1 

Install dhcp Package
# yum install dhcp* -y

step  -2

Configure dhcp server
DHCP creates an empty configuration file /etc/dhcp/dhcpd.conf. Also it provides a sample configuration file at /usr/share/doc/dhcp*/dhcpd.conf.sample, which is very useful for configuring the DHCP server.
# vi /etc/dhcp/dhcpd.conf

step - 3

Copy Dhcp configuration in /etc dir.
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

Now open for configuration
option domain-name "";
option domain-name-servers;
default-lease-time 600;
max-lease-time 7200;

log-facility local7; 

We are configuring DHCP for LAN network

# A slightly different configuration for an internal subnet.

subnet netmask {
option domain-name-servers; # dns Server name
option domain-name "";
option routers; # default gateway
# option broadcast-address;
default-lease-time 600;
max-lease-time 7200;

set IP address to host
host client1 {
option host-name "";
hardware ethernet 08:00:07:26:c0:a5;

Restart Service

# service dhcpd restart

To monitor dhcp leases just type in terminal

# vi /var/lib/dhcpd/dhcpd.leases

Next Post »