Setup DHCP Server


untuk instalasi DHCP di slackware, yang dibutuhkan adalah paket /slackware/n/dhcp-3.0.4-i486-2.tgz di CD

install seperti biasa, ato dengan cara manual
installpkg dhcp-3.0.4-i486-2.tgz

setelah selesai, langsung edit aja file konfigurasinya
(file konfigurasi sesuaikan dengan kondisi di tempat masing-masing)

# ISC DHCP-Server Configuration
# /etc/dhcpd.conf
#
default-lease-time 86400 ; # one day
max-lease-time 604800 ; # one week
ddns-update-style ad-hoc ;
ddns-updates on;
option ip-forwarding off;
option routers 192.168.2.1 ; # important when this corresponds to: ‘gateway’
option subnet-mask 255.255.255.0 ;
ignore client-updates ;
option broadcast-address 192.168.2.255 ;
option domain-name “mydomain.com” ;
option domain-name-servers 194.22.190.10 , 194.22.194.14; # important when this corresponds to: ‘DNS Servers’
#
# LAN
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.40 192.168.2.60;
}

# DMZ
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.40 192.168.3.60;
}
#
# List an unused interface here
subnet 192.168.1.0 netmask 255.255.255.128 {
}

kemudian test, mode debug

shell> killall dhcpd
shell> dhcpd -d &

Cek script init untuk dhcp di
/etc/rc.d/rc.local

sh ./rc.dhcpd start

Jika belum ada file rc.dhcpd, buat sendiri. misalnya seperti ini:

#!/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
#
#############################################

CONFIGFILE=”/etc/dhcpd.conf”
LEASEFILE=”/var/state/dhcp/dhcpd.leases”
INTERFACES=”eth1″
OPTIONS=”-q”

#############################################

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 “$1” in
‘start’)
dhcpd_start ;;
‘stop’)
dhcpd_stop ;;
‘restart’)
dhcpd_restart ;;
*)
echo “usage $0 start|stop|restart” ;;
esac

ok gitu aja
Ref:

ISC actual information. http://www.isc.org/index.pl?/sw/dhcp/dhcpv3-README.php
http://www.faqs.org/docs/Linux-mini/DHCP.html#SLACKWARE some old.
http://www.linux.se/doc/HOWTO/mini/DHCP/index.html some old.
http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html How handle security.
http://alex.kruijff.org/FreeBSD/Dynamic_DNS.html How to set up DHCP to interact with a DNS server.

5 comments

  1. Dedi Iskandar · ·

    mas bayu, kemarin saya masang fedora8, setelah #yum install dhcpd, progresnya ok2 saja. masalahnya dhcpnya ga mo dihidupkan, padahal aplikasinya ada di mesin saya. Ngecek di /var/log/message, ada ada pesanya, aneh…Kira – kira masalahnya dimana ya?
    thx

    bayu:

    setelah menjalankan service dhcpd melalui
    service dhcpd start

    cek dengan perintah netstat -pln, apakah dhcp sudah aktif atau belom
    port 67
    untuk log nya, silahkan mengacu ke konfigurasi dhcpd nya.

    ref :
    http://www.fedoraguide.info/index.php/Main_Page#DHCP_Server_.28dhcpd.29

  2. kang ora · ·

    kang bayu…

    usul gimana kalo text yg digunakan dalam contoh script sampeyan di sini, pake nya plain-text?

    nampaknya font sampeyan kalo di-copy lalu langsung di-paste ke vi atau notepad bakal muncul bbrp karakter lucu deh…

    bisa2 yg mem-paste ( halah bahasanya😛 ) bingung, knp kok dhcpd-nya tak kunjung jalan pdhl sdh sesuai juklak kang bayu di sini xixixixi… >:)

    reff: http://slackware.osuosl.org/slackware/usb-and-pxe-installers/etherboot/rc.dhcpd

    bayu:

    ok thanks mas ata sinfo nya…
    soalnya pas nulis dulu, pake rich editor
    lain kali murni teks or disisipin

  3. mas mo nanya nih gimana sih cara instalasi DHCP server di mandriva 2008.1???? mohon bantuannya segera ya mas. Thanks before

    bayu:

    dhcp server pake apa ?
    kalo pake dnsmasq tinggal install aja pake perintah urpmi dnsmasq trus edit file konfigurasinya di /etc/dnsmasq.conf di bagian di dhcp

    kalo pake dhcpd juga hampir sama, install dari urpmi. trus konfigurasi ada di /etc/dhcpd.conf
    sulitnya dimana ?

    bukane install standar lansgung bisa dipake ?

  4. assalamualaikum, mas saya mau tanya, gimana cara installasi dhcp server di mandriva 2008 di konsol mas?? karena buat laporan tugas akhir saya di sekolah…,thanks

    bayu :

    dari konsole, ketik perintah berikut

    [root@pop box]# urpmi dhcp

    http://opensource.telkomspeedy.com/repo/mandriva/2008.1/i586/media/main/release/dhcp-server-3.0.6-5mdv2008.1.i586.rpm
    installing dhcp-server-3.0.6-5mdv2008.1.i586.rpm from /var/cache/urpmi/rpms
    Preparing... #############################################
    1/1: dhcp-server #############################################
    [root@pop box]#

    tu kalo di komputerku, biasane sih dhcp client juga ke install, tekan Y or enter aja
    abis tu tinggal edit konfigurasi dhcp server nya

    [root@pop box]# vim /etc/dhcpd.conf

    isinya kaya ini

    ddns-update-style none;
    subnet 192.168.0.0 netmask 255.255.255.0 {
    # default gateway
    option routers 192.168.0.1;
    option subnet-mask 255.255.255.0;

    option domain-name "domain.org";

    # Seting up an ip address is better here
    option domain-name-servers ns.domain.org;
    option nis-domain "domain.org";

    range dynamic-bootp 192.168.0.128 192.168.0.254;
    default-lease-time 21600;
    max-lease-time 43200;

    # we want the nameserver to appear at a fixed address
    host ns {
    next-server fixed.mandrakesoft.com;
    hardware ethernet 12:34:56:78:AB:CD;
    fixed-address 192.168.0.10;
    }
    }

    nah konfig (default) diatas udah bisa di pake langsung. gampang kan pake Mandriva ??🙂

    untuk ngejalanin tu dhcp server, pake printah :

    [root@pop box]# /etc/init.d/dhcpd
    Usage: dhcpd {start|stop|restart|condrestart|status}
    [root@pop box]#

    or

    root@pop box]# service dhcpd
    I need an action
    Usage: dhcpd {start|stop|restart|condrestart|status}
    [root@pop box]#

    tinggal tambahin start buat ngejalanin, trus stop buat nyetop
    beres deh…

  5. yoskovick · ·

    numpang tanya om,. setelah configurasi dhcp saya start melalu #service dhcpd start dan alhasil OK. TAPI KENAPA ,. setelah komputer restart DHCP tidak bisa jalan otomatis, kira kira apa yg salah yak?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: