Wednesday, April 03, 2013

Setting up DHCP server on Linux | Cent OS 6

Tech Blog - Here is a quick how to setting up DHCP service on a Linux box, this is done on a Cent OS 6 installation, but configuration should apply to other flavours as well.

First we install the dhcpd package from the yum repository

yum -y install dhcp.i686

Once done we edit the configuration file  dhcpd.conf in /etc/dhcp, below configuration will assign IP range to 169, to any client requesting IP it will also assign a fixed/static address to host desktop12 with the MAC address C8:60:00:D0:69:5F.

vi /etc/dhcp/dhcpd.conf
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
ddns-update-style ad-hoc;
default-lease-time 12000;
max-lease-time 92000;
option subnet-mask;
option broadcast-address;
option routers;
option domain-name "";
option domain-name-servers;

subnet netmask {
#   range;
#   range;


use-host-decl-names on;
subnet netmask {
        group {
                filename "linux/pxelinux.0";

# Desktop:
   host desktop12 {
   hardware ethernet C8:60:00:D0:69:5F;

Now we start the DHCP service.

#/etc/init.d/dhcp start 

Then were done.


No comments:

For suggestion and concerns E-mail