Teknik Konfigurasi DHCP Server dan DHCP Relay pada Cisco Packet Tracer

I Made Nugrahe Jaye Putra
4 min readFeb 5, 2022

Hi, disini saya akan memberikan tutorial tentang cara konfigurasi DHCP Server dan DHCP relay pada Cisco Packet Tracer.

DHCP (Dynamic Host Configuration Protocol) adalah protokol yang dipakai untuk memudahkan penyebaran alamat IP (internet protocol) secara otomatis ke perangkat lainnya.

TOPOLOGI JARINGAN

Topologi Jaringan

CHAPTER 1 : Router Configuration

  1. Konfigurasi Sub-Interface R1

Router>enable
Router#
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
hostname R1
R1(config)#
interface gigabitEthernet 0/0
R1(config-if)#
no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R1(config-if)#ex

R1(config)#interface gigabitEthernet 0/1
R1(config-if)#
ip address 10.20.20.1 255.255.255.252
R1(config-if)#
no shutdown

R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

R1(config-if)#ex
R1(config)#
interface gigabitEthernet 0/0.10
%LINK-5-CHANGED: Interface GigabitEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.10, changed state to up

R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#
ip address 192.168.10.1 255.255.255.248
R1(config-subif)#
ex
R1(config)#
interface gigabitEthernet 0/0.20
%LINK-5-CHANGED: Interface GigabitEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.20, changed state to up

R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#
ip address 192.168.10.9 255.255.255.248
R1(config-subif)#
ex

2. Konfigurasi DHCP Server pada R1

R1(config)#ip dhcp excluded-address 192.168.10.1
R1(config)#
ip dhcp pool KELAS_1
R1(dhcp-config)#
network 192.168.10.0 255.255.255.248
R1(dhcp-config)#
default-router 192.168.10.1
R1(dhcp-config)#
dns-server 8.8.8.8
R1(dhcp-config)#
exit
R1(config)#
ip dhcp excluded-address 192.168.10.9
R1(config)#
ip dhcp pool KELAS_2
R1(dhcp-config)#
network 192.168.10.8 255.255.255.248
R1(dhcp-config)#
default-router 192.168.10.9
R1(dhcp-config)#
dns-server 8.8.8.8
R1(dhcp-config)#
exit
R1(config)#
ip dhcp excluded-address 192.168.10.17
R1(config)#
ip dhcp pool KELAS_3
R1(dhcp-config)#
network 192.168.10.16 255.255.255.248
R1(dhcp-config)#
default-router 192.168.10.17
R1(dhcp-config)#
dns-server 8.8.8.8
R1(dhcp-config)#
exit

Penjelasan :
ip dhcp excluded-address a.b.c.d = mengkonfigurasi dhcp pool agar tidak memberikan ip yang tidak akan disebar.

ip dhcp pool NAMA = menambahkan pool atau sebuah grup DHCP.

network a.b.c.d netmask = memberikan informasi Net ID yang akan menjadi patokan IP yang akan diberikan.

default-router a.b.c.d = memberikan informasi IP gateway yang akan diberikan pada pool tersebut.

dns-server a.b.c.d = memberikan informasi IP DNS Server yang akan diberikan pada pool tersebut.

3. Konfigurasi Routing pada R1

R1(config)#router rip
R1(config-router)#
version 2
R1(config-router)#
network 192.168.10.0
R1(config-router)#
network 10.20.20.0
R1(config-router)#
exit

Penjelasan :

router rip = membuat sebuah routing rip baru.

version 2 = menggunakan rip version 2.

network a.b.c.d = memberikan informasi network pada tabel routing.

4. Konfigurasi DHCP Relay dan Routing RIP pada R2

Router>enable
Router#
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
hostname R2
R2(config)#
interface gigabitEthernet 0/0
R2(config-if)#
ip address 10.20.20.2 255.255.255.252
R2(config-if)#
no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

R2(config-if)#ex
R2(config)#
interface gigabitEthernet 0/1
R2(config-if)#
ip address 192.168.10.17 255.255.255.248
R2(config-if)#
ip helper-address 10.20.20.1
R2(config-if)#
no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

R2(config-if)#ex

R2(config)#router rip
R2(config-router)#
version 2
R2(config-router)#
network 192.168.10.0
R2(config-router)#
network 10.20.20.0
R2(config-router)#
ex

Penjelasan :

ip helper-address a.b.c.d = adalah sebuah metode suatu interface untuk meminta DHCP melalui IP yang terhubung dengan DHCP Server.

CHAPTER 2 : Switch Configuration

Switch>enable
Switch#
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
hostname SW
SW(config)#
vlan 10
SW(config-vlan)#
name KELAS_1
SW(config-vlan)#
exit
SW(config)#
vlan 20
SW(config-vlan)#
name KELAS_2
SW(config-vlan)#
ex
SW(config)#
interface vlan 10
%LINK-5-CHANGED: Interface Vlan10, changed state to up

SW(config-if)#ex
SW(config)#
interface vlan 20
%LINK-5-CHANGED: Interface Vlan20, changed state to up

SW(config-if)#ex
SW(config)#
interface fastEthernet 0/1
SW(config-if)#
switchport access vlan 10
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

SW(config-if)#exit
SW(config)#
interface fastEthernet 0/2
SW(config-if)#
switchport access vlan 20
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

SW(config-if)#exit
SW(config)#
interface gigabitEthernet 0/1
SW(config-if)#
switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

SW(config-if)#end

CHAPTER 3 : Testing DHCP and Ping

  1. Klik pada masing-masing PC, pilih Desktop > IP Configuration > DHCP. Jika berhasil maka masing-masing PC akan mendapatkan IP Address yang sesuai.
PC 1
PC 2
PC 3

2. Melakukan ping ke masing-masing PC.

PC 1 ke PC 2
PC 1 ke PC 3

Demikian tutorial yang bisa saya berikan, jika terdapat pertanyaan silahkan tanyakan ke Telegram atau Whatsapp saya. Terima kasih !

My Telegram

My Whatsapp

--

--