DHCP atau Dynamic Host Configuration Protocol, merupakan salah satu mekanisme pemberian IP pada komputer host atau client secara otomatis. Mekanismenya adalah menggantikan peran administrator jaringan dalam, terutama saat memasukkan IP Address di setiap komputer Client. Prinsip kerjasanya kurang lebih adalah sebagai berikut, pada saat Server DHCP aktif, maka server DHCP menyediakan range IP pada kelas tertentu, sesuai dengan aturan yang ditetapkan oleh admin. Kemudian, pada saat komputer client yang terhubung ke jaringan aktif, sistem operasi akan mencari ke DHCP server, apakah ada IP yang bisa direservasi. Jika ada, maka Server DHCP akan memberikan IPtersebut.
Pada DHCP, lama waktu IP yang diberikan pada setiap komputer bisa dibuat dinamis, artinya setelah pada waktu tertentu, maka IP yang ada pada komputer client akan habis masa penggunaannya. Ini disebut lease IP. Ada juga yang sifatnya, IP tersebut tetap berada di komputer client, selama kartu jaringannya tidak rusak tentunya.
Berikut adalah konfigurasi DHCP server di linux. Distro yang digunakan adalah Fedora Core 4.
Untuk mengkonfigurasinya, dibutuhkan priveledge tertinggi, yaitu root.
#rpm -qa | grep dhcp
dhcpv6_client-0.10-13
dhcp-3.0.2-12
setelah terinstall, DHCP server memberikan contoh konfigurasi dhcpd.conf, filenya dapat kita liat dan kopi di /usr/share/doc/dhcp-3.0.2/dhcpd.conf.sample
berikut adalah contoh script dhcpd.conf:
Pada DHCP, lama waktu IP yang diberikan pada setiap komputer bisa dibuat dinamis, artinya setelah pada waktu tertentu, maka IP yang ada pada komputer client akan habis masa penggunaannya. Ini disebut lease IP. Ada juga yang sifatnya, IP tersebut tetap berada di komputer client, selama kartu jaringannya tidak rusak tentunya.
Berikut adalah konfigurasi DHCP server di linux. Distro yang digunakan adalah Fedora Core 4.
Untuk mengkonfigurasinya, dibutuhkan priveledge tertinggi, yaitu root.
#rpm -qa | grep dhcp
dhcpv6_client-0.10-13
dhcp-3.0.2-12
setelah terinstall, DHCP server memberikan contoh konfigurasi dhcpd.conf, filenya dapat kita liat dan kopi di /usr/share/doc/dhcp-3.0.2/dhcpd.conf.sample
berikut adalah contoh script 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”jakarta”;
option domain-name-servers 192.168.1.3;
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”jakarta”;
option domain-name-servers 192.168.1.3;
# ini buat tamu , 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;
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 kantor, jadi walaupun di pindah-pindah IP nya tetep
#=====================================
#Host Team Alpha
#=====================================
#1. komputer nanang
host nanang {
hardware ethernet 00:02:a5:2f:c5:5b;
fixed-address 192.168.1.6;
}
#2. komputer wildan
host wildan {
hardware ethernet 00:e0:4c:d3:66:7e;
fixed-address 192.168.1.7;
}
#3. komputer syaiful
host syaiful {
hardware ethernet 20:04:12:30:31:7A;
fixed-address 192.168.1.8;
}
#4. komputer gian
host gian {
hardware ethernet 00:50:8b:fe:f5:50;
fixed-address 192.168.1.9;
#5 komputer hikmat
host hikmat {
hardware ethernet 00:11:2f:c7:e0:b1;
fixed-address 192.168.1.10;
}
#Host Team Alpha
#=====================================
#1. komputer nanang
host nanang {
hardware ethernet 00:02:a5:2f:c5:5b;
fixed-address 192.168.1.6;
}
#2. komputer wildan
host wildan {
hardware ethernet 00:e0:4c:d3:66:7e;
fixed-address 192.168.1.7;
}
#3. komputer syaiful
host syaiful {
hardware ethernet 20:04:12:30:31:7A;
fixed-address 192.168.1.8;
}
#4. komputer gian
host gian {
hardware ethernet 00:50:8b:fe:f5:50;
fixed-address 192.168.1.9;
#5 komputer hikmat
host hikmat {
hardware ethernet 00:11:2f:c7:e0:b1;
fixed-address 192.168.1.10;
}
#6 komputer ismail
host ismail {
hardware ethernet 00:14:2a:04:d9:d1;
fixed-address 192.168.1.11;
}
host ismail {
hardware ethernet 00:14:2a:04:d9:d1;
fixed-address 192.168.1.11;
}
#7
host agunglaptop {
hardware ethernet 00:0a:e4:03:3f:ae;
fixed-address 192.168.1.12;
}
host agunglaptop {
hardware ethernet 00:0a:e4:03:3f:ae;
fixed-address 192.168.1.12;
}
#8
host it-engineer {
hardware ethernet 00:e0:4c:e0:1e:88;
fixed-address 192.168.1.13;
}
#9
host sapuademo {
hardware ethernet 00:0a:e4:12:c7:60;
fixed-address 192.168.1.14;
}
host it-engineer {
hardware ethernet 00:e0:4c:e0:1e:88;
fixed-address 192.168.1.13;
}
#9
host sapuademo {
hardware ethernet 00:0a:e4:12:c7:60;
fixed-address 192.168.1.14;
}
#10
host marketing {
hardware ethernet 00:c0:9f:c4:60:12;
fixed-address 192.168.1.15;
}
host marketing {
hardware ethernet 00:c0:9f:c4:60:12;
fixed-address 192.168.1.15;
}
#11
host agung-laptop {
hardware ethernet 00:04:23:7d:f7:8b;
fixed-address 192.168.1.20;
}
#12
host marketing-laptop {
hardware ethernet 00:14:a4:27:7d:a1;
fixed-address 192.168.1.21;
}
host agung-laptop {
hardware ethernet 00:04:23:7d:f7:8b;
fixed-address 192.168.1.20;
}
#12
host marketing-laptop {
hardware ethernet 00:14:a4:27:7d:a1;
fixed-address 192.168.1.21;
}
#13
host pipit-laptop {
hardware ethernet 00:17:42:03:f3:f6;
fixed-address 192.168.1.22;
}
# alokasi IP address untuk server/ perangkat sapua
#13 Wireless Lan IP
host sapua {
hardware ethernet 00:90:4c:91:00:01;
fixed-address 192.168.1.2;
}
#14 Server dummy sapua
host server.sapua {
hardware ethernet 00:E0:4C:44:D4:56;
fixed-address 192.168.1.3;
}
}
host pipit-laptop {
hardware ethernet 00:17:42:03:f3:f6;
fixed-address 192.168.1.22;
}
# alokasi IP address untuk server/ perangkat sapua
#13 Wireless Lan IP
host sapua {
hardware ethernet 00:90:4c:91:00:01;
fixed-address 192.168.1.2;
}
#14 Server dummy sapua
host server.sapua {
hardware ethernet 00:E0:4C:44:D4:56;
fixed-address 192.168.1.3;
}
}
nah setelah konfigurasi selesai, aktifkan daemon dhcp
# /etc/init.d/dhcpd start
Memulai dhcpd: [ OK ]
# /etc/init.d/dhcpd start
Memulai dhcpd: [ OK ]
Untuk Melihat, apakah konfigurasi kita berjasil atau tidak, dhcpd mencatat list client yang mendapat reservasi IP dari server, filenya bisa kita lihat di :
/var/lib/dhcp/dhcpd.leases
berikut contoh isi filenya :
[root@b6-uninet-personal-106-142 ~]# more /var/lib/dhcp/dhcpd.leases
# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don’t ask about it. There is no portable way to
# store leases in the local timezone, so please don’t request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don’t ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.2
/var/lib/dhcp/dhcpd.leases
berikut contoh isi filenya :
[root@b6-uninet-personal-106-142 ~]# more /var/lib/dhcp/dhcpd.leases
# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don’t ask about it. There is no portable way to
# store leases in the local timezone, so please don’t request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don’t ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.2
lease 192.168.1.31 {
starts 1 2006/09/11 09:05:21;
ends 1 2006/09/11 15:05:21;
tstp 1 2006/09/11 15:05:21;
binding state free;
hardware ethernet 00:0d:5e:22:2b:1f;
uid “\001\000\015^\”+\037″;
}
lease 192.168.1.34 {
starts 2 2006/09/12 02:40:22;
ends 2 2006/09/12 08:40:22;
tstp 2 2006/09/12 08:40:22;
binding state active;
next binding state free;
hardware ethernet 00:00:00:00:00:00;
uid “\001\000\000\000\000\000\000″;
client-hostname “marketing”;
}
starts 1 2006/09/11 09:05:21;
ends 1 2006/09/11 15:05:21;
tstp 1 2006/09/11 15:05:21;
binding state free;
hardware ethernet 00:0d:5e:22:2b:1f;
uid “\001\000\015^\”+\037″;
}
lease 192.168.1.34 {
starts 2 2006/09/12 02:40:22;
ends 2 2006/09/12 08:40:22;
tstp 2 2006/09/12 08:40:22;
binding state active;
next binding state free;
hardware ethernet 00:00:00:00:00:00;
uid “\001\000\000\000\000\000\000″;
client-hostname “marketing”;
}
0 Response to "DHCP Server Fedora Core 4"
Posting Komentar