Berikut contoh konfigurasi DHCP Server di router Cisco (paling umum untuk lab/Packet Tracer). Misal LAN kamu 192.168.10.0/24 dan gateway 192.168.10.1.
1) Set IP interface LAN (gateway)
conf t
interface g0/0
ip address 192.168.10.1 255.255.255.0
no shutdown
exit
2) Exclude IP yang tidak boleh dibagikan DHCP
ip dhcp excluded-address 192.168.10.1 192.168.10.20
(artinya DHCP mulai bagi dari .21 ke atas)
3) Buat DHCP pool
ip dhcp pool LAN10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8 1.1.1.1
domain-name lab.local
lease 7
exit
end
4) Simpan konfigurasi
copy running-config startup-config
5) Cek DHCP jalan
- Lihat pool:
show ip dhcp pool
- Lihat siapa saja yang dapat IP:
show ip dhcp binding
- Cek konflik:
show ip dhcp conflict
Kalau DHCP tidak dapat IP (troubleshoot cepat)
- Pastikan interface LAN up/up:
show ip interface brief - Pastikan PC diset DHCP dan “Renew”
- Pastikan tidak ada DHCP lain di jaringan yang bentrok
Kalau jaringan kamu pakai VLAN (router-on-a-stick), bilang VLAN dan subnetnya (mis. VLAN10=192.168.10.0/24, VLAN20=192.168.20.0/24), nanti aku tuliskan DHCP untuk tiap VLAN juga.
