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    ”servercomputing.com”;


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


#Set lease time
default-lease-time 600;


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


#activate dhcp server
authoritative;


#Add your ip address pool in below format. In this example network 192.168.10.0/24 and ip address pool is 192.168.10.201  to 250 for clients,gateway=192.168.10.1.
subnet 192.168.10.0 netmask 255.255.255.0 {
  range dynamic-bootp 192.168.10.201 192.168.10.250;
  option broadcast-address 192.168.10.255;
  option routers 192.168.10.1;
}


#This is the way to Reserve an ip address 192.168.10.29  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;
  fixed-address 192.168.10.29;
}


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 ?

1 comments:

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