Difference between revisions of "Instalasi DHCP Server"
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Tentunya mesin / client di [[LAN]] tersebut harus di set agar dapat menerima alokasi [[IP address]] secara automatic. | Tentunya mesin / client di [[LAN]] tersebut harus di set agar dapat menerima alokasi [[IP address]] secara automatic. | ||
+ | ==Instalasi== | ||
Instalasi [[DHCP Server]] di Ubuntu | Instalasi [[DHCP Server]] di Ubuntu | ||
− | sudo apt-get install | + | sudo apt-get install isc-dhcp-server |
+ | |||
+ | |||
Dalam mengkonfigurasi [[DHCP Server]], kita biasanya membutuhkan informasi | Dalam mengkonfigurasi [[DHCP Server]], kita biasanya membutuhkan informasi | ||
Line 15: | Line 18: | ||
* [[netmask]], misalnya, 255.255.255.0 | * [[netmask]], misalnya, 255.255.255.0 | ||
+ | ==Konfigurasi== | ||
− | + | Edit | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | vi /etc/dhcp/dhcpd.conf | ||
Line 33: | Line 32: | ||
max-lease-time 172800; # 48 jam | max-lease-time 172800; # 48 jam | ||
option domain-name "warnet.net" | option domain-name "warnet.net" | ||
+ | option domain-name-servers 8.8.8.8, 8.8.4.4; | ||
+ | |||
+ | atau gunakan DNS ISP anda, | ||
+ | |||
option domain-name-servers 202.134.2.5, 203.130.196.5; | option domain-name-servers 202.134.2.5, 203.130.196.5; | ||
Line 44: | Line 47: | ||
} | } | ||
+ | Contoh lain | ||
+ | |||
+ | |||
+ | subnet 192.168.0.0 netmask 255.255.255.0 { | ||
+ | range 192.168.0.150 192.168.0.170; | ||
+ | option domain-name-servers ns1.your_domain.com; | ||
+ | option domain-name "local.your_domain.com"; | ||
+ | option subnet-mask 255.255.255.0; | ||
+ | option routers 192.168.0.1; | ||
+ | option broadcast-address 192.168.0.255; | ||
+ | default-lease-time 600; | ||
+ | max-lease-time 7200; | ||
+ | } | ||
+ | |||
+ | ==Restart== | ||
+ | Restart | ||
− | + | /etc/init.d/isc-dhcp-server restart | |
− | + | atau | |
+ | stop isc-dhcp-server | ||
+ | start isc-dhcp-server | ||
Latest revision as of 13:13, 10 October 2018
DHCP Server berfungsi untuk memberikan IP address secara automatis ke mesin-mesin di Jaringan LAN. Tentunya mesin / client di LAN tersebut harus di set agar dapat menerima alokasi IP address secara automatic.
Instalasi
Instalasi DHCP Server di Ubuntu
sudo apt-get install isc-dhcp-server
Dalam mengkonfigurasi DHCP Server, kita biasanya membutuhkan informasi
- DNS Server, misalnya, 202.134.2.5, 203.130.196.5
- Gateway / router, misalnya, 192.168.0.1
- Range alokasi IP address, misalnya, 192.168.0.100 s/d 192.168.0.200
- subnet, misalnya, 192.168.0.0
- netmask, misalnya, 255.255.255.0
Konfigurasi
Edit
vi /etc/dhcp/dhcpd.conf
Isinya kira-kira sebagai berikut
ddns-update-style none; authoritative; default-lease-time 86400; # 24 jam max-lease-time 172800; # 48 jam option domain-name "warnet.net" option domain-name-servers 8.8.8.8, 8.8.4.4;
atau gunakan DNS ISP anda,
option domain-name-servers 202.134.2.5, 203.130.196.5;
atau menggunakan OpenDNS
option domain-name-servers 208.67.222.222, 208.67.220.220;
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200; option routers 192.168.0.1; }
Contoh lain
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.150 192.168.0.170; option domain-name-servers ns1.your_domain.com; option domain-name "local.your_domain.com"; option subnet-mask 255.255.255.0; option routers 192.168.0.1; option broadcast-address 192.168.0.255; default-lease-time 600; max-lease-time 7200; }
Restart
Restart
/etc/init.d/isc-dhcp-server restart
atau
stop isc-dhcp-server start isc-dhcp-server
DHCP Server Dengan Beberapa LAN Card
Jika kita memiliki beberapa LAN card, kita harus memberitahu LAN card mana saja akan di aktifkan DHCP Server tersebut. Edit file /etc/default/dhcp3-server
# nano /etc/default/dhcp3-server
Misalnya kita ingin mengaktifkan DHCP Server pada interface eth0, eth1, dan wlan0, maka isi file dhcp3-server dengan perintah
INTERFACES="eth0 eth1 wlan0"
Default DHCP Server akan menggunakan LAN card pertama, biasanya eth0.