Difference between revisions of "Instalasi DHCP Server"
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(14 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | [[DHCP Server]] berfungsi untuk memberikan [[IP address]] secara automatis ke mesin-mesin di Jaringan LAN. | + | [[DHCP Server]] berfungsi untuk memberikan [[IP address]] secara automatis ke mesin-mesin di Jaringan [[LAN]]. |
− | Tentunya mesin di [[LAN]] tersebut harus di set agar IP address 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 isc-dhcp-server | |
+ | |||
Line 12: | Line 14: | ||
* [[DNS Server]], misalnya, 202.134.2.5, 203.130.196.5 | * [[DNS Server]], misalnya, 202.134.2.5, 203.130.196.5 | ||
* [[Gateway]] / [[router]], misalnya, 192.168.0.1 | * [[Gateway]] / [[router]], misalnya, 192.168.0.1 | ||
− | * Range alokasi IP address, misalnya, 192.168.0.100 s/d 192.168.0.200 | + | * Range alokasi [[IP address]], misalnya, 192.168.0.100 s/d 192.168.0.200 |
− | * subnet, misalnya, 192.168.0.0 | + | * [[subnet]], misalnya, 192.168.0.0 |
− | * netmask, misalnya, 255.255.255.0 | + | * [[netmask]], misalnya, 255.255.255.0 |
+ | ==Konfigurasi== | ||
− | + | Edit | |
+ | |||
+ | vi /etc/dhcp/dhcpd.conf | ||
− | |||
Isinya kira-kira sebagai berikut | 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 "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 31: | Line 43: | ||
subnet 192.168.0.0 netmask 255.255.255.0 { | subnet 192.168.0.0 netmask 255.255.255.0 { | ||
− | range 192.168.0.100 192.168.0.200 | + | 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. | ||
Line 46: | Line 90: | ||
* [[Linux Howto]] | * [[Linux Howto]] | ||
+ | * [[Tip Membangun Server Sendiri]] | ||
+ | |||
+ | [[Category: Linux]] | ||
+ | [[Category: DHCP]] | ||
+ | [[Category: Internet]] |
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.