fahran on January 17 2010 06:58:47Kategori : LinuxSetelah Beberapa jam Konfigurasi DHCP di slackware akhirnya selesai juga..hhuffhh.Untuk konfigurasi DHCP Server di slackware, kita hanya tinggal mengedit file konfigurasinya saja. Untuk file konfigurasinya berada di /etc/dhcpd.conf untuk defaultnya file ini tidak ada isinya. Sebelumnya kita cek dulu slackware di computer kita apa sudah memiliki paket DHCP Server apa blom.
fahran@slacker:~# ls /var/log/packages/ | grep dhcp
Untuk paket yang dipakai : dhcp-3.0.6-i486-1
Jika sudah terinstall maka selanjutnya kita tinggal mengeditnya..
fahran@slacker:~# vi /etc/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "wedusupnvj.org";
option domain-name-servers 192.168.10.10;
ket : Domain Name dari server dhcp anda, jika ada. atau bisa diisi sebagai penamaan host lokal anda, tanpa harus menggunakan domain yang terdaftar.
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
ket : Lease time, adalah waktu yang dialokasikan ketika sebuah IP Address dipinjamkan kepada komputer client, setelah waktu pinjam ini selesai, maka IP tersebut dapat dipinjam lagi oleh komputer yang sama, atau komputer tersebut mendapatkan IP Address lain jika komputer yang sebelumnya dipinjam dipergunakan oleh komputer lain. default-lease-time, maksudnya adalah lama waktu server meminjamkan alamat ip kepada client, dalam satuan detik, 600 detik. sedangankan max-lease-time adalah waktu maksimum yang di alokasikan untuk peminjaman ip oleh dhcp server ke client dalam satuan detik, 7200 detik.
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 192.168.10.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.11 192.168.10.20;
#option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 192.168.10.0 netmask 255.255.255.0 {
# range dynamic-bootp 192.168.10.100 192.168.10.255;
# option broadcast-address 192.168.10.254;
# option routers rtr-239-32-1.example.org;
#}
# A slightly different configuration for an internal subnet.
#subnet 192.168.10.0 netmask 255.255.255.0 {
#range 192.168.10.100 192.168.10.200;
#option domain-name-servers 192.168.10.10;
#option domain-name "wedusupnvj.org";-> nama domain kita samakan saja di /etc/hosts
#option routers 192.168.10.1; –> gateway untuk pc klient eth0 server
#option broadcast-address 192.168.10.255; –> ini broadcastrnya
#default-lease-time 600;
#max-lease-time 7200;
#}
Untuk mengaktifkan DHCP Server gunakan perintah:
fahran@slacker:~# /usr/sbin/dhcpd
setelah dijalanin nanti akan muncul :
Internet Systems Consortium DHCP Server V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.
** Ignoring requests on start. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface start is attached.
** Not configured to listen on any interfaces!
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software – please
send them to the appropriate mailing list as described in
the README file.
exiting.
*** coba saja jalankan dhclient di komputer client, pasti akan dapat ip dari dhcp server yang kita bikin.
jika ingin melihat komputer yang pernah terhubung dengan dhcp server kita,
lihat isi file :
/var/state/dhcp/dhcpd.leases
di dalam folder ini terdapat file yang berakhiran .lease
ini adalah log dari dhcp (baik dhcp-client maupun dhcp-server)
Supaya DHCP Server aktif setiap kali boot maka masukkan di rc.local:
fahran@slacker:~# echo "/usr/sbin/dhpcd" >> /etc/rc.d/rc.local
Jika belum jalan juga DHCP servernya kita buat sebuah shell file “rc.dhcpd” di dalam folder “/etc/rc.d/” untuk itu kita buat dengan Text Editor :
#!/bin/sh
#
# /etc/rc.d/rc.dhcpd
#
# Start/stop/restart the DHCP daemon.
#
# To make dhcpd start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.dhcpd
#
#############################################
dhcpd_start() {
if [ -x /usr/sbin/dhcpd -a -r $CONFIGFILE ]; then
echo “Starting DHCPD…”
/usr/sbin/dhcpd -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
# /usr/sbin/dhcpd -q $INTERFACES
fi
}
dhcpd_stop() {
killall dhcpd
}
dhcpd_restart() {
dhcpd_stop
sleep 2
dhcpd_start
}
case “$1r43; in
’start’)
dhcpd_start ;;
’stop’)
dhcpd_stop ;;
‘restart’)
dhcpd_restart ;;
*)
echo “usage $0 start|stop|restart” ;;
esac
setelah kita buat sebuah shell “rc.dhcpd” selanjutnya file ini kita executable agar bias di eksekusi dengan perintah :
chmod 755 /etc/rc.d/rc.dhcpd
akhirnya selesai juga buat DHCP Server di slackware…..hhuffh
smoga bermanfaat….
_____________________________________________________________________________
Dapatkan Artikel Terbaru dari www.mentorupnvj.co.cc melewati RSS Feeds
atau lewat e-mail Anda
masukkan alamat e-mail anda di form ini :
Suka dengan Artikel ini ?, Silahkan Bookmark Artikel ini.
boddocwra on August 29 2010 13:18:56 Hi there, I dont know if I am writing in a proper board but I have got a problem with activation, link i receive in email is not working... [url=ht... >>Read More
nyul on August 15 2010 14:29:06 makasih tutorialnya mas...
[url=http://psychobone.dagdigdug.com/2010/08/08/hosting-profesional-indonesia-yang-murah/]Hosting Profesional Indones... >>Read More
Likoveriko on August 12 2010 11:36:09 Äà è ìíå ñòàòüÿ ïðèãîäèëàñü...[url=http://moskva-rt.... >>Read More
katiemaci on August 11 2010 20:28:08 Hi there, I dont know if I am writing in a proper board but I have got a problem with activation, link i receive in email is not working... [url=ht... >>Read More
candidamckec on July 09 2010 00:28:48 It is conceivably killed if potassium bicarbonateitric hypoparathyroid is found in [url=http://forum.foxestail.com/index.php?topic=24277.0]Zithroma... >>Read More