Setup DHCP server CentOS 5


-Install paket DHCP server
# yum -y install dhcp

-Backup File Original Konfigurasi DHCP
# mv /etc/dhcpd.conf /etc/dhcpd.conf.asli

-File contoh default konfigurasi dhcp ada di /usr/share/doc/dhcp-versidhcp/dhcpd.conf.sample
Copy file terserbut ke /etc/dhcpd.conf untuk diedit :

# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf

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

ddns-update-style interim; 
ignore client-updates;
authoritative;
subnet 192.168.88.0 netmask 255.255.255.0 {

# --- default gateway 
option routers 192.168.88.1;
option subnet-mask 255.255.255.0;

# option nis-domain "domain.org";
# option domain-name "domain.org";
option domain-name-servers 192.168.88.1,192.168.0.1,192.168.1.1,8.8.8.8;

# option time-offset +25200; # Western Indonesian Time
# option ntp-servers 192.168.1.1;
option netbios-name-servers 192.168.88.11;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.88.100 192.168.88.200;
# Dalam Detik(seconds)
default-lease-time 518400;
max-lease-time 604800;

# Untuk set ip statik bisa tidak dalam range ip dhcp
host pckuwin7 {
# next-server marvin.redhat.com;
hardware ethernet 00:01:02:03:04:05;
fixed-address 192.168.88.99;
{
 
host vm1-xpsp3 {
# next-server marvin.redhat.com;
hardware ethernet 06:07:08:09:10:11;
fixed-address 192.168.88.51;
}
 
host vm2-xpsp3 {
# next-server marvin.redhat.com;
hardware ethernet 12:13:14:15:16:17;
fixed-address 192.168.88.52;
}
}

 
-Edit /etc/sysconfig/dhcpd disetting untuk listen pada eth1(LAN internal),Isikan dengan script sbb:
# vi /etc/sysconfig/dhcpd

DHCPDARGS=eth1

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

-Restart service DHCP server
# service dhcpd restart
or
# /etc/init.d/dhcpd restart

Leave a Reply

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