Install and configure DHCP server on centos 6

By | 2013/03/11

1. install dhcp server

#yum install dhcp

2. Check Local config

DEVICE="eth0"
HWADDR="00:0C:29:F1:01:4B"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="none"
IPADDR=192.168.1.11
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

3. Edit /etc/sysconfig/dhcpd

# Command line options here
DHCPDARGS=eth0

4. Edit /etc/dhcp/dhcpd.conf

#specify domain name
option domain-name "krizna.com";
#specify DNS server ip and additional DNS server ip
option domain-name-servers 192.168.1.10, 208.67.222.222;
#specify default lease time
default-lease-time 600;
#specify Max lease time
max-lease-time 7200;
#specify log method
log-facility local7;
#Configuring subnet and iprange
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.254;
option broadcast-address 192.168.1.255;
#Default gateway ip
option routers 192.168.1.1;
}
#Fixed ip address based on MAC id
host Printer01 {
hardware ethernet 02:34:37:24:c0:a5;
fixed-address 192.168.1.55;
}

5. Now start the service

# service dhcpd start

 

One thought on “Install and configure DHCP server on centos 6

Leave a Reply

Your email address will not be published. Required fields are marked *