DHCP (Dynamic Configuration Protocol) adalah layanan yang secara otomatis memberikan nomor IP kepada komputer yang memintanya. Komputer yang memberikan nomor IP disebut sebagaiDHCP server, sedangkan komputer yang meminta nomor IP disebut sebagai DHCP Client. Dengan demikian administrator tidak perlu lagi harus memberikan nomor IP secara manual pada saat konfigurasi TCP/IP, tapi cukup dengan memberikan referensi kepada DHCP Server.
Pada saat kedua DHCP client dihidupkan , maka komputer tersebut melakukan request ke DHCP-Server untuk mendapatkan nomor IP. DHCP menjawab dengan memberikan nomor IP yang ada di database DHCP. DHCP Server setelah memberikan nomor IP, maka server meminjamkan (lease) nomor IP yang ada ke DHCP-Client dan mencoret nomor IP tersebut dari daftar pool. Nomor IP diberikan bersama dengan subnet mask dan default gateway. Jika tidak ada lagi nomor IP yang dapat diberikan, maka client tidak dapat menginisialisasi TCP/IP, dengan sendirinya tidak dapat tersambung pada jaringan tersebut.
Setelah periode waktu tertentu, maka pemakaian DHCP Client tersebut dinyatakan selesai dan client tidak memperbaharui permintaan kembali, maka nomor IP tersebut dikembalikan kepada DHCP Server, dan server dapat memberikan nomor IP tersebut kepada Client yang membutuhkan. Lama periode ini dapat ditentukan dalam menit, jam, bulan atau selamanya. Jangka waktu disebut leased period.
Kelebihan DHCP
1. Memudahkan dalam transfer data kepada PC client lain atau PC server.
2. DHCP menyediakan alamat-alamat IP secara dinamis dan konfigurasi lain. DHCP ini didesain untuk melayani network yang besar dan konfigurasi TCP/IP yang kompleks.
3. DHCP memungkinkan suatu client menggunakan alamat IP yang reusable, artinya alamat IP tersebut bisa dipakai oleh client yang lain jika client tersebut tidak sedang menggunakannya (off).
4. DHCP memungkinkan suatu client menggunakan satu alamat IP untuk jangka waktu tertentu dari server.
5. DHCP akan memberikan satu alamat IP dan parameter-parameter kofigurasi lainnya kepada client.
Mengkonfigurasi DHCP Client dan Server
lab1@lab1-desktop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:95:c7:0b:ad
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
eth1 Link encap:Ethernet HWaddr 00:e0:4d:39:83:ed
inet addr:192.168.0.126 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe39:83ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1751 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:153884 (153.8 KB) TX bytes:6024 (6.0 KB)
Interrupt:23 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:49 errors:0 dropped:0 overruns:0 frame:0
TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3992 (3.9 KB) TX bytes:3992 (3.9 KB)
lab1@lab1-desktop:~$ ping google.com
ping: unknown host google.com
lab1@lab1-desktop:~$ ping www.google.com
ping: unknown host www.google.com
lab1@lab1-desktop:~$ ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100) 56(84) bytes of data.
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=0.112 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=0.097 ms
64 bytes from 192.168.0.100: icmp_seq=3 ttl=64 time=0.108 ms
64 bytes from 192.168.0.100: icmp_seq=4 ttl=64 time=0.111 ms
64 bytes from 192.168.0.100: icmp_seq=5 ttl=64 time=0.103 ms
64 bytes from 192.168.0.100: icmp_seq=6 ttl=64 time=0.095 ms
64 bytes from 192.168.0.100: icmp_seq=7 ttl=64 time=0.095 ms
64 bytes from 192.168.0.100: icmp_seq=8 ttl=64 time=0.098 ms
64 bytes from 192.168.0.100: icmp_seq=9 ttl=64 time=0.098 ms
64 bytes from 192.168.0.100: icmp_seq=10 ttl=64 time=0.099 ms
64 bytes from 192.168.0.100: icmp_seq=11 ttl=64 time=0.094 ms
64 bytes from 192.168.0.100: icmp_seq=12 ttl=64 time=0.097 ms
64 bytes from 192.168.0.100: icmp_seq=13 ttl=64 time=0.102 ms
64 bytes from 192.168.0.100: icmp_seq=14 ttl=64 time=0.095 ms
64 bytes from 192.168.0.100: icmp_seq=15 ttl=64 time=0.098 ms
64 bytes from 192.168.0.100: icmp_seq=16 ttl=64 time=0.098 ms
64 bytes from 192.168.0.100: icmp_seq=17 ttl=64 time=0.100 ms
64 bytes from 192.168.0.100: icmp_seq=18 ttl=64 time=0.097 ms
^C
--- 192.168.0.100 ping statistics ---
18 packets transmitted, 18 received, 0% packet loss, time 16998ms
rtt min/avg/max/mdev = 0.094/0.099/0.112/0.013 ms
lab1@lab1-desktop:~$ ls etc/init.d/
ls: cannot access etc/init.d/: No such file or directory
lab1@lab1-desktop:~$ ls /etc/init.d/
acpid hwclock-save rsync
acpi-support irqbalance rsyslog
alsa-mixer-save kerneloops saned
anacron killprocs screen-cleanup
apparmor lm-sensors sendsigs
apport module-init-tools single
atd networking skeleton
avahi-daemon network-interface speech-dispatcher
binfmt-support network-interface-security ssh
bluetooth network-manager stop-bootlogd
bootlogd ondemand stop-bootlogd-single
brltty openbsd-inetd udev
console-setup pcmciautils udev-finish
cron plymouth udevmonitor
cups plymouth-log udevtrigger
dbus plymouth-splash ufw
dmesg plymouth-stop umountfs
dns-clean pppd-dns umountnfs.sh
failsafe-x procps umountroot
fancontrol pulseaudio unattended-upgrades
gdm rc urandom
grub-common rc.local vsftpd
halt rcS wpa-ifupdown
hostname README x11-common
hwclock reboot
lab1@lab1-desktop:~$ /home/ftp/tool$ sudo dpkg -i dhcp-server_3.1.3-2ubuntu3.3i386.deb
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ sudo dpkg -i dhcp-server_3.1.3-2ubuntu3.3_i386.deb
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ sudo dpkg -i dhcp3-server_3.1.3-2ubuntu3.3_amd64.deb
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ sudo nano /etc/network/interfacr
[sudo] password for lab1:
lab1@lab1-desktop:~$ sudo nano /etc/init.d/network/interface/
lab1@lab1-desktop:~$ sudo nano /etc/init.d/network/interface/
lab1@lab1-desktop:~$ /home/ftp/tool$ etc/dhcp3/dhcp.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ etc /dhcp3/dhcp.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ /etc /dhcp3/dhcp.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ /etc/dhcp3/dhcp.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ etc/dhcp3/dhcp.conf
bash: etc/dhcp3/dhcp.conf: No such file or directory
lab1@lab1-desktop:~$ etc/dhcp3/dhcpd.conf
bash: etc/dhcp3/dhcpd.conf: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ /etc/dhcp3/dhcpd.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ /home/ftp/tool$ etc/dhcp3/dhcpd.conf
bash: /home/ftp/tool$: No such file or directory
lab1@lab1-desktop:~$ if config eth0
> /home/ftp/tool$ etc/dhcp3/dhcpd.conf^C
lab1@lab1-desktop:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:11:95:c7:0b:ad
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
lab1@lab1-desktop:~$ sudo vi /etc/network interfaces
2 files to edit
[1]+ Stopped sudo vi /etc/network interfaces
lab1@lab1-desktop:~$ sudo vi /etc/network interface
2 files to edit
[2]+ Stopped sudo vi /etc/network interface
lab1@lab1-desktop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:95:c7:0b:ad
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
eth1 Link encap:Ethernet HWaddr 00:e0:4d:39:83:ed
inet addr:192.168.0.126 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe39:83ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11554 errors:0 dropped:0 overruns:0 frame:0
TX packets:508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1074919 (1.0 MB) TX bytes:42467 (42.4 KB)
Interrupt:23 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:921 errors:0 dropped:0 overruns:0 frame:0
TX packets:921 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:73392 (73.3 KB) TX bytes:73392 (73.3 KB)
lab1@lab1-desktop:~$ ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:e0:4d:39:83:ed
inet addr:192.168.0.126 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe39:83ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11592 errors:0 dropped:0 overruns:0 frame:0
TX packets:508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1081004 (1.0 MB) TX bytes:42467 (42.4 KB)
Interrupt:23 Base address:0x2000
lab1@lab1-desktop:~$ sudo vi /etc/network interfaces
2 files to edit
[3]+ Stopped sudo vi /etc/network interfaces
lab1@lab1-desktop:~$ sudo nano /etc/network interfaces
lab1@lab1-desktop:~$ sudo nano /etc/networkinterfaces
lab1@lab1-desktop:~$ sudo nano /etc/network/interfaces
lab1@lab1-desktop:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces... Ignoring unknown interface eth1=eth1.
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth1/00:e0:4d:39:83:ed
Sending on LPF/eth1/00:e0:4d:39:83:ed
Sending on Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.0.65 from 192.168.0.254
DHCPREQUEST of 192.168.0.65 on eth1 to 255.255.255.255 port 67
DHCPACK of 192.168.0.65 from 192.168.0.254
bound to 192.168.0.65 -- renewal in 266 seconds.
[ OK ]
lab1@lab1-desktop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:95:c7:0b:ad
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
eth1 Link encap:Ethernet HWaddr 00:e0:4d:39:83:ed
inet addr:192.168.0.65 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe39:83ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12169 errors:0 dropped:0 overruns:0 frame:0
TX packets:535 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1144825 (1.1 MB) TX bytes:47153 (47.1 KB)
Interrupt:23 Base address:0x2000
eth0:avahi Link encap:Ethernet HWaddr 00:11:95:c7:0b:ad
inet addr:169.254.8.30 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:937 errors:0 dropped:0 overruns:0 frame:0
TX packets:937 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:74576 (74.5 KB) TX bytes:74576 (74.5 KB)
lab1@lab1-desktop:~$ ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:e0:4d:39:83:ed
inet addr:192.168.0.65 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4dff:fe39:83ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12205 errors:0 dropped:0 overruns:0 frame:0
TX packets:535 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1148657 (1.1 MB) TX bytes:47153 (47.1 KB)
Interrupt:23 Base address:0x2000
lab1@lab1-desktop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
link-local * 255.255.0.0 U 0 0 0 eth0
default 192.168.0.254 0.0.0.0 UG 100 0 0 eth1
lab1@lab1-desktop:~$ uslookup
No command 'uslookup' found, did you mean:
Command 'nslookup' from package 'dnsutils' (main)
uslookup: command not found
lab1@lab1-desktop:~$
Untuk penginstalan
lab1@lab1-desktop:~$ cd ..
lab1@lab1-desktop:/home$ cd D
bash: cd: D: No such file or directory
lab1@lab1-desktop:/home$ ls
ftp lab1
lab1@lab1-desktop:/home$ cd lab1
lab1@lab1-desktop:~$ ls
Desktop Downloads Music Public Videos
Documents examples.desktop Pictures Templates
lab1@lab1-desktop:~$ cd D
Desktop/ Documents/ Downloads/
lab1@lab1-desktop:~$ cd D
Desktop/ Documents/ Downloads/
lab1@lab1-desktop:~$ cd Downloads/
lab1@lab1-desktop:~/Downloads$ ls
12_ok_mail_rev(2).doc 9_pdc(2).doc
12_ok_mail_rev.doc 9_pdc.doc
12_Pertanyaan_mail(2).doc 9_Pertanyaan_PDC(2).doc
12_Pertanyaan_mail(3).doc 9_Pertanyaan_PDC.doc
12_Pertanyaan_mail.doc dhcp3-client_3.1.3-2ubuntu3.3_i386.deb
14_Pertanyaan_wireless(2).doc dhcp3-common_3.1.3-2ubuntu3.3_i386.deb
14_Pertanyaan_wireless.doc dhcp3-server_3.1.3-2ubuntu3.3_amd64.deb
14_wireless(2).doc dhcp3-server_3.1.3-2ubuntu3.3_i386.deb
14_wireless.doc DHCP Server(2).ppt
1_Network Tools(2).doc DHCP Server.ppt
1_Network Tools.doc DNS Theory.ppt
1_Pertanyaan_ Network_Tool(2).doc Mail Server.ppt
1_Pertanyaan_ Network_Tool.doc openssh-server_1%3a5.3p1-3ubuntu7_i386.deb
4_Pertanyaan_SSH_SFTP(2).doc PRAK4 TELNET DAN FTP.pdf
4_Pertanyaan_SSH_SFTP.doc telnetd_0.17-36build1_i386.deb
4_sshdan SFTP(2).doc vsftpd_2.2.2-3ubuntu6.1_i386(2).deb
4_sshdan SFTP.doc vsftpd_2.2.2-3ubuntu6.1_i386.deb
lab1@lab1-desktop:~/Downloads$ sudo dpkg -i dhcp3-common_3.1.3-2ubuntu3.3_i386.deb
(Reading database ... 123289 files and directories currently installed.)
Preparing to replace dhcp3-common 3.1.3-2ubuntu3 (using dhcp3-common_3.1.3-2ubuntu3.3_i386.deb) ...
Unpacking replacement dhcp3-common ...
Setting up dhcp3-common (3.1.3-2ubuntu3.3) ...
Processing triggers for man-db ...
lab1@lab1-desktop:~/Downloads$ sudo dpkg -i dhcp3-client_3.1.3-2ubuntu3.3_i386.deb
(Reading database ... 123289 files and directories currently installed.)
Preparing to replace dhcp3-client 3.1.3-2ubuntu3 (using dhcp3-client_3.1.3-2ubuntu3.3_i386.deb) ...
Unpacking replacement dhcp3-client ...
Setting up dhcp3-client (3.1.3-2ubuntu3.3) ...
Processing triggers for man-db ...
lab1@lab1-desktop:~/Downloads$ sudo dpkg -i dhcp3-server_3.1.3-2ubuntu3.3_
dpkg: error processing dhcp3-server_3.1.3-2ubuntu3.3_ (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
dhcp3-server_3.1.3-2ubuntu3.3_
lab1@lab1-desktop:~/Downloads$ ls
12_ok_mail_rev(2).doc 9_pdc(2).doc
12_ok_mail_rev.doc 9_pdc.doc
12_Pertanyaan_mail(2).doc 9_Pertanyaan_PDC(2).doc
12_Pertanyaan_mail(3).doc 9_Pertanyaan_PDC.doc
12_Pertanyaan_mail.doc dhcp3-client_3.1.3-2ubuntu3.3_i386.deb
14_Pertanyaan_wireless(2).doc dhcp3-common_3.1.3-2ubuntu3.3_i386.deb
14_Pertanyaan_wireless.doc dhcp3-server_3.1.3-2ubuntu3.3_amd64.deb
14_wireless(2).doc dhcp3-server_3.1.3-2ubuntu3.3_i386.deb
14_wireless.doc DHCP Server(2).ppt
1_Network Tools(2).doc DHCP Server.ppt
1_Network Tools.doc DNS Theory.ppt
1_Pertanyaan_ Network_Tool(2).doc Mail Server.ppt
1_Pertanyaan_ Network_Tool.doc openssh-server_1%3a5.3p1-3ubuntu7_i386.deb
4_Pertanyaan_SSH_SFTP(2).doc PRAK4 TELNET DAN FTP.pdf
4_Pertanyaan_SSH_SFTP.doc telnetd_0.17-36build1_i386.deb
4_sshdan SFTP(2).doc vsftpd_2.2.2-3ubuntu6.1_i386(2).deb
4_sshdan SFTP.doc vsftpd_2.2.2-3ubuntu6.1_i386.deb
lab1@lab1-desktop:~/Downloads$ sudo dpkg -i dhcp3-server_3.1.3-2ubuntu3.3_i386.deb
Selecting previously deselected package dhcp3-server.
(Reading database ... 123289 files and directories currently installed.)
Unpacking dhcp3-server (from dhcp3-server_3.1.3-2ubuntu3.3_i386.deb) ...
Setting up dhcp3-server (3.1.3-2ubuntu3.3) ...
Generating /etc/default/dhcp3-server...
* Starting DHCP server dhcpd3 * check syslog for diagnostics.
[fail]
invoke-rc.d: initscript dhcp3-server, action "start" failed.
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
lab1@lab1-desktop:~/Downloads$ ^C
NANO
# Sample configuration file for ISC dhcpd for Debian
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
option domain-name "eitpolnes.net";
option domain-name-servers 192.168.0.254;
default-lease-time 600;
max-lease-time 7200;
# 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.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.150;
}
# This is a very basic subnet declaration.