Wednesday 25 January 2012

Setting DHCP Server Di RedHat 9

Tags


Setting DHCP Server Di RedHat 9

Yang pertama apa sih DHCP itu ^_^ DHCP (Dynamic Configuration Protocol) adalah layanan yang secara otomatis memberikan nomor IP kepada komputer yang memintanya. Komputer yang memberikan nomor IP disebut sebagai DHCP server, sedangkan komputer yang meminta nomor IP disebut sebagai DHCP Client.
instalasi dan konfigurasi:
Instalasi
Untuk mendapatkan software DHCP, Anda dapat mendownload dari website resminya di ISC atau dari CD Instaler Linux Redhat.
Berikut ini akan dijelaskan langkah-langkah instalasi dari source code.
§ Salin software yang telah didownload dalam bentuk file tar ball ke /usr/local/src
# mv dhcp-3.0.1lrc9.tar.gz /usr/local/src
§ Ekstrak file DHCP dengan mengetikkan perintah berikut:
# cd /usr/local/src/
# tar xvfz dhcp-server-3.0.1rc9.tar.gz
§ Lalu lakukan konfigurasi dengan perintah configure, sebelumnya masuk kedirektori dhcp yang sudah diekstrak.
# cd dhcp-3.0.1rc9
# ./configure
§ Kemudian kompilasi hasil konfigurasi yang telah dilakukan dengan cara:
# make
§ Instlasi paket yang telah dikompilasi dengan perintah:
# make install
* pada Redhat9, dhcpd.conf tidak diletakkan secara defaults di directory /etc , namun untungnya, ada contoh file nya dan diletakkan di /usr/share/doc/dhcp-0pl1/dhcpd.conf.sample . nah sample ini yang kemudian kita kopikan ke direktori /etc
# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf
* setelah itu .. baru lakukan perubahan …
berikut adalah contoh dari konfigurasi DHCP server
# cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
#definisi subnet
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name “smkn2banjar.ac.id”;
option domain-name-servers 202.145.0.1,202.145.0.2,202.146.225.63
# ini buat orang lain yang ingin bergabung, jadi mereka tinggal colok kabel aja
range dynamic-bootp 192.168.1.30 192.168.1.35;
default-lease-time 21600;
max-lease-time 43200;
#kalo yang ini buat komputer-komputer yang ada di lab, jadi walaupun di pindah-pindah IP nya tetap
#1
host komp1 {
hardware ethernet 00:14:2a:04:d9:d1;
fixed-address 192.168.1.6;
}
#2
host komp2{
hardware ethernet 00:e0:4c:e0:1e:88;
fixed-address 192.168.1.5;
}
#3
host komp3{
hardware ethernet 00:0d:87:d1:07:81;
fixed-address 192.168.1.7;
}
#4
host komp4 {
hardware ethernet 00:e0:4c:43:ee:c2;
fixed-address 192.168.1.9;
}
#5
host komp5 {
hardware ethernet 00:0e:a6:5d:4a:c1;
fixed-address 192.168.1.8;
}
#6
host komp6 {
hardware ethernet 00:0a:e4:12:c7:60;
fixed-address 192.168.1.14;
}
#7
host komp7 {
hardware ethernet 00:0a:e4:03:3f:ae;
fixed-address 192.168.1.12;
}
#8
host komp8 {
hardware ethernet 00:e0:98:ab:1f:b9;
fixed-address 192.168.1.11;
}
#9
host komp9 {
hardware ethernet 00:e0:4c:d3:66:7e;
fixed-address 192.168.1.13;
}
}
#10
host komp10 {
hardware ethernet 00:c0:9f:c4:60:12;
fixed-address 192.168.1.15;
}
#11
hostkomp11 {
hardware ethernet 00:11:2f:c7:e0:b1;
fixed-address 192.168.1.10;
}
OK, setelah di konfigurasi, jalankan daemon dhcpd
# /etc/init.d/dhcpd start
Cek IP addres sudah terpakai atau belum bisa dilihat di :
tail -f /var/lib/dhcp/dhcpd.leases


Emoticon Emoticon