Configure DHCP Server in Linux

This configuration will work on all RPM based linux distributions (Redhat,Fedora,CentOS,etc.)

Steps to install and configure a DHCP Server

Step1: Install dhcp packages
[root@server ~#]yum install dhcp

Step2: Edit the dhcp configuration file located in /etc/dhcp/dhcpd.conf
[root@server ~#]vi /etc/dhcp/dhcpd.conf
#[Note: The lines to add or edit in dhcpd.conf file is colored brown. Enable the lines by removing ‘#’ if required and edit. Allways backup the configuration file before editing.]

#Add your domain name
option domain-name    ””;

#Add DNS  server addresses(for clients)
option domain-name-servers,;

#Set lease time
default-lease-time 600;

#set maximum lease time
max-lease-time 7200;

#activate dhcp server

#Add your ip address pool in below format. In this example network and ip address pool is  to 250 for clients,gateway=
subnet netmask {
  range dynamic-bootp;
  option broadcast-address;
  option routers;

#This is the way to Reserve an ip address  for a special client named Accounts . [ MAC address based reservation]. Here 00:E0:5D:A0:6A:0C is the mac address of accounts pc’s NIC card(optional).
host Accounts {
  hardware ethernet 00:E0:5D:A0:6A:0C;

Step3: Start dhcp service
[root@server ~#]service dhcpd start

Step4: Add dhcp service to startup
[root@server ~#]chkconfig dhcpd on

Step5: To do in client computers
Set Obtain ip automatically in all windows and “Use DHCP” in linux client computers.

Was this helpfull ?


Paula Lewis said...

Nicest information!!! I'll be enchanted to greatly help due to what I've learnt from here. Linus Torvalds

Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons