Welcome to


Rohit Mehta : A Linux Follower

bangalore, Karnataka, India
hi! i m a person who is chill all time. Since jan 2008 i am working for Novell software. The word Impossible does not exist in my dictionary because Impossible says i m possible...hey guys have fun with linux...it begins but has no end......

Tuesday, November 17, 2009

How To Configure Dhcp Server On Redhat/Linux

Dynamic Host Configuration Protocol (DHCP) is a network application protocol used by devices to obtain configuration information for operation in an Internet Protocol network .This protocol reduces system administration and we can add new devices easily within the network.
DHCP also finds application in booting the diskless station.Diskless station sends out RARP signal to dhcp server and the server in response gives the ip-address along with netmask and gateway.
Configuring dhcp server is not a difficult task and dhcp-server can be setup with some easy steps mentioned below
Step 1. )First of all check whether the package is installed on your system or not.we can check this by :-
#rpm –qa|grep dhcp
A package named dhcp-3.0.5-18.el5.rpm should show up..If it shows up in the result that means the package is installed on your system.Otherwise install it through yum.This can be done by running the following command
#yum install dhcp
or use the following command.
#rpm –ivh 3.0.5-18.el5
Again check with rpm –qa|grep dhcp..The package should show up now.
Step 2.)Linux by default doesn’t put the default dhcp configuration file in location but does it in some other location.
To move to its original location type the following commands
# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf
**Location of the default file may vary with linux versions.So one can find the file using the following command:
#locate dhcpd.conf.sample
Step 3.)Edit the dhcp configuration file with your favourite editor:
I am using vi for this:
vi /etc/dhcpd.conf
add the following parameters:
subnet netmask {
option routers;
option subnet-mask;
option domain-name “thedomain.com”;
option domain-name-servers;
option time-offset -18000; # Eastern Standard Time
Step 4.) Save and exit from the editor.
Step 5. )For other dhcp option go to dhcp man page..
# man dhcp-options
Step 6.) Next we need to create a new .leases file because older versions don’t have the .leases file by default :
# touch /var/lib/dhcp/dhcpd.leases
Step 7.)Start the dhcpd service:
#service dhcpd start
Step 8.)If any changes are made to the configuration settings then we need to restart the service:
# service dhcpd restart
Step 9.)dhcp server is up and running.
Step10.)To enable dhcp service at boot time,go for following command:
#chkconfig dhcpd on

No comments:

Which Linux distribution has ease of use?