Dynamic Host Configuration Protocol (DHCP) is a client/server protocol helps to assign ip address automatically and dynamically to client machine.In this post we will learn how to install and configure DHCP server in RHEL 5.
Note: DHCP runs on UDP port 67 for the DHCP serve and UDP port 68 for the DHCP client machines.
Steps to install and configure DHCP server
(1) Install DHCP Package :
yum install dhcpd (in Redhat based OS)
(2) Edit file /etc/dhcpd.conf:
vi /etc/dhcpd.conf
(3) Configure /etc/dhcpd.conf file:
Paste given below contents in /etc/dhcpd.conf file and save it
ddns-update-style interim;
ignore client-updates;
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.66 10.1.1.199;
# --- default gateway
option routers 10.1.1.1;
option subnet-mask 255.255.255.0;
option ip-forwarding off;
#option nis-domain "domain.org";
#option domain-name "domain.org";
option domain-name-servers 222.x.x.x, 222.y.y.y;
option broadcast-address 10.255.255.255;
#option time-offset 39600; # Eastern Standard Time
#option netbios-name-servers 10.1.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
option netbios-node-type 8;
default-lease-time 1209600;
max-lease-time 1209600;
}
(4) Then restart the dhcpd service:
service dhcpd restart
