Konfigurasi Cisco Router sebagai DHCP Server: membuat pool, mengecualikan IP statis, menetapkan gateway dan DNS, serta DHCP Relay Agent untuk multi-VLAN.
Daftar Isi
Ringkasan Eksekutif (TL;DR)
- Kecualikan IP statis DULU:
ip dhcp excluded-address [awal] [akhir] - Buat pool:
ip dhcp pool [nama] - Jaringan:
network [ip-network] [mask] - Gateway:
default-router [ip-gateway] - DNS:
dns-server [ip-dns] - DHCP Relay (multi-subnet):
ip helper-address [ip-dhcp-server]pada interface klien.
DHCP (Dynamic Host Configuration Protocol) memungkinkan perangkat mendapatkan konfigurasi IP secara otomatis — IP address, subnet mask, gateway, dan DNS. Cisco Router dapat berfungsi sebagai DHCP Server yang handal.
Selalu definisikan IP yang dikecualikan (router, server, printer) sebelum membuat pool DHCP. Jika tidak, router bisa mendistribusikan IP tersebut ke klien sebelum Anda sempat mengecualikannya.
1. Konfigurasi DHCP untuk LAN / VLAN 10 (HRD)
! Langkah 1: Kecualikan IP statis (.1 = router, .2-.10 = server/printer)
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
! Langkah 2: Buat DHCP Pool
R1(config)# ip dhcp pool POOL-HRD
R1(dhcp-config)# network 192.168.10.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.10.1
R1(dhcp-config)# dns-server 8.8.8.8 8.8.4.4
R1(dhcp-config)# lease 7
! lease 7 = masa sewa IP selama 7 hari
R1(dhcp-config)# exit
2. Konfigurasi DHCP untuk VLAN 20 (Keuangan)
R1(config)# ip dhcp excluded-address 192.168.20.1 192.168.20.10
R1(config)# ip dhcp pool POOL-KEUANGAN
R1(dhcp-config)# network 192.168.20.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.20.1
R1(dhcp-config)# dns-server 8.8.8.8 8.8.4.4
R1(dhcp-config)# lease 7
R1(dhcp-config)# exit
3. DHCP Relay Agent (ip helper-address)
DHCP menggunakan broadcast yang tidak bisa melewati router. Jika DHCP Server berada di jaringan lain, gunakan DHCP Relay Agent agar broadcast DHCP dari klien diteruskan sebagai unicast ke DHCP Server.
! DHCP Server terpusat di 192.168.100.10
! Konfigurasi ip helper-address pada interface yang menghadap klien
R1(config)# interface fastethernet 0/0.10
R1(config-subif)# ip helper-address 192.168.100.10
R1(config-subif)# exit
R1(config)# interface fastethernet 0/0.20
R1(config-subif)# ip helper-address 192.168.100.10
R1(config-subif)# exit
4. Verifikasi DHCP
! Lihat IP yang sudah terdistribusi
R1# show ip dhcp binding
IP address Client-ID/Hardware address Lease expiration Type
192.168.10.11 0100.50ab.cdef.12 Jul 28 2026 08:00 AM Automatic
192.168.20.11 0100.50ab.cdef.34 Jul 28 2026 08:00 AM Automatic
! Statistik DHCP
R1# show ip dhcp server statistics
! Hapus semua binding (untuk troubleshooting)
R1# clear ip dhcp binding *
Klien kini mendapatkan IP secara otomatis. Jaringan semakin fungsional! Selanjutnya kita akan mengontrol siapa yang boleh mengakses apa dengan Access Control List (ACL).