Setup DHCP Server CentOS 6

-Install DHCP server
# yum -y install dhcp

-Backup dhcpd.conf
# mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.asli

-File sampel default konfigurasi dhcp ada di /usr/share/doc/dhcp-versidhcp/dhcpd.conf.sample
Copy file tersebut ke /etc/dhcpd.conf untuk diedit.
# cp /usr/share/doc/dhcp-*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

-Edit /etc/dhcp/dhcpd.conf:
# vi /etc/dhcp/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

#Opt auto detect proxy:
#option wpad-url code 252 = text;

subnet netmask {
range dynamic-bootp;
option domain-name-servers,;
option netbios-name-servers;
option domain-name "";
option routers;
option broadcast-address;

#Opt auto detect proxy:
#option wpad-url "\n";

#Leased time in second, 1day=24h=86400s
default-lease-time 86400;
max-lease-time 604800;

# Fixed IP addresses can outside range ip dhcp 
host pcku-win7 {
 hardware ethernet 00:30:67:CB:52:64;

host vm1-xpsp3 {
 hardware ethernet 00:0c:29:15:48:44;

host vm2-xpsp3 {
 hardware ethernet 00:0c:29:91:6d:a4;

-Edit /etc/sysconfig/dhcpd disetting untuk listen pada eth1 (DHCP listen):
# vi /etc/sysconfig/dhcpd


-To make the dhcp server start at boot time, issue the commands:
# chkconfig dhcpd on

-Restart service DHCP
# service dhcpd restart

Leave a Reply

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