DHCP SERVER

Installation and Configuration of DHCP Server ( RHEL5 )

Step 1: – Login to the server which will be designated as the DHCP server with the root login and password.
Step 2: – Launch a terminal window and check if DHCP rpm packages are already install as follows.

[root@test1 ~]# rpm -qa | grep dhcp
dhcp-devel-3.0.5-3.el5
dhcp-3.0.5-3.el5</pre>
If you get the above output then “DHCP” packages are already installed, if you do not get the above output then proceed to “Step 3”
Step 3: - Copy the dhcp rpm packages from the RHEL5 installation CD’s to /root partition and then follow the installation steps as mentioned.
<pre># mount /dev/cdrom /media
# cd /media/Server
# ls | grep dhcp
# cp dhcp-3.0.5-3.el5.i386.rpm /root
# cp dhcp-devel-3.0.5-3.el5.i386.rpm /root
# cd
# umount /media
# cd /root
# rpm –ivh dhcp-3.0.5-3.el5.i386.rpm
# rpm –ivh dhcp-devel-3.0.5-3.el5.i386.rpm 

Step 4: - Copy the sample dhcp configuration file to the proper location

# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# cd /etc/
# vi dhcpd.conf 

Delete whatever is there in dhcpd.conf file and then add the below entries in the dhcpd.conf file, below is the
dhcpd.conf file for “Pilot site JJMUM” which is as per our requirement the only changes will be in the IP’s, As
different locations will have different IP pools and DNS servers.

-----------------------------------------------------------------------------------------------------------
Contents of dhcpd.conf file for example

authoritative;
ddns-update-style interim;
ignore client-updates;
#-------------------EAST-------------------------------------
subnet 172.16.145.0 netmask 255.255.255.0 {
option routers 172.16.145.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 172.16.130.11;
range dynamic-bootp 172.16.145.100 172.16.145.254;
default-lease-time 21600;
max-lease-time 43200;
}
#-------------------EAST-2------------------------------------
subnet 172.16.150.0 netmask 255.255.255.0 {
option routers 172.16.150.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 172.16.130.11;
range dynamic-bootp 172.16.150.100 172.16.150.254;
default-lease-time 21600;
max-lease-time 43200;
}  

Step 5:- Check if the dhcp leases file exists if not touch it, If exiting proceed to the next step.

[root@DIR01 ~]# locate dhcpd.leases
/usr/share/man/man5/dhcpd.leases.5.gz
/var/lib/dhcpd/dhcpd.leases 

If the locate command dose not display “/var/lib/dhcpd/dhcpd.leases” touch the file.

# touch /var/lib/dhcp/dhcpd.leases 

Step 6:- Testing

dhcpd -T  To check if dhcpd.leases is OK
dhcpd -t  To check if dhcpd.conf syntax is OK
Step 7:- Start DHCP service

# chkconfig –-level 35 dhcpd on
# service dhcpd start  

Check /var/log/messages for any errors, If found any errors trouble shoot accordingly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s