Fitur DHCP Server pada Linux CentOS jarang sekali digunakan, karena fitur ini sudah terdapat pada perangkat jaringan yang umum digunakan seperti Router, ataupun Modem. Namun walaupun demikian, kita bisa saja menggunakan fitur dhcp server ini untuk alternatif apabila perangkat utama tersebut bermasalah. Atau mungkin untuk sekedar memisahkan fungsi DHCP dari perangkat Router yang dikhususkan untuk Routing dan Filtering, dan Modem yang dikhususkan untuk Dial Internet.
Disini saya akan mengkonfigurasi Linux Centos 5 sebagai DHCP Server untuk melayani Jaringan Lokal (LAN). IP Address Server yakni 192.168.1.101/24. Berikut langkah-langkah instalasi :
INSTALL PAKET DHCP
[root@MAJAPAHIT ~]# yum install dhcp
File konfigurasi utama berada di /etc/dhcpd.conf. Sedangkan contoh konfigurasi berada di /usr/share/doc/dhcp*/dhcpd.conf.sample.
KONFIGURASI DHCP
- DHCP Dinamis (Dynamic DHCP)
[root@MAJAPAHIT ~]# nano /etc/dhcpd.conf
- Isi File:
ddns-update-style interim;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option routers 192.168.1.101;
option domain-name-servers 192.168.1.101;
default-lease-time 600;
max-lease-time 604800;
range 192.168.1.50 192.168.1.60;
}
- Dari client, setting IP dinamis (obtain). Berikut contoh ip yang diperoleh dari client windows :
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::5482:7f32:f34d:9e37%17(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.60(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Thursday, January 16, 2014 2:11:44 PM
Lease Expires . . . . . . . . . . : Thursday, January 16, 2014 2:21:47 PM
Default Gateway . . . . . . . . . : 192.168.1.101
DHCP Server . . . . . . . . . . . : 192.168.1.101
DNS Servers . . . . . . . . . . . : 192.168.1.101
NetBIOS over Tcpip. . . . . . . . : Disabled
- DHCP Statis (Static DHCP)
ddns-update-style interim;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option routers 192.168.1.101;
option domain-name-servers 192.168.1.101;
#option ntp-servers 192.168.1.101;
default-lease-time 600;
max-lease-time 604800;
range 192.168.1.50 192.168.1.60;
# List IP Statik
host myNotebook {
hardware ethernet 00:50:56:C0:00:01;
fixed-address 192.168.1.55;
}
}
- Hasil dari client Windows
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::5482:7f32:f34d:9e37%17(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.55(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Thursday, January 16, 2014 2:20:08 PM
Lease Expires . . . . . . . . . . : Thursday, January 16, 2014 2:30:12 PM
Default Gateway . . . . . . . . . : 192.168.1.101
DHCP Server . . . . . . . . . . . : 192.168.1.101
DNS Servers . . . . . . . . . . . : 192.168.1.101
NetBIOS over Tcpip. . . . . . . . : Disabled
[root@MAJAPAHIT ~]# cat /var/lib/dhcpd/dhcpd.leases
Informasi Client yang sedang terhubung :
lease 192.168.1.60 {
starts 4 2014/01/16 14:14:58;
ends 4 2014/01/16 14:24:58;
tstp 4 2014/01/16 14:24:58;
binding state active;
next binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "ASUS-PC";
}
lease 192.168.1.60 {
starts 4 2014/01/16 14:14:58;
ends 4 2014/01/16 14:19:50;
tstp 4 2014/01/16 14:19:50;
binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
}
Tidak ada komentar:
Posting Komentar