Wednesday 30 April 2014

LAB Konfigurasi Ruter sebagai DHCP server dan sebagai DHCP RELAY


Pada lab ini akan dibuat:
1. R1 sebagai DHCP server bagi PC0 dan PC1
2. R1 sebagai DHCP relay dan Server0 sebagai DHCP server bagi PC0 dan PC1

Skenario 1: R1 sebagai DHCP server untuk PC0 dan PC1
Preparasi Switch S1
Switch# conf t
Switch(config)# hostname S1
S1(config)# interface fa0/1
S1(config-if)# switchport mode access
S1(config-if)# switchport access vlan 10
S1(config-if)# interface fa0/2
S1(config-if)# description link_to_R1
S1(config-if)# switchport mode trunk
S1(config-if)# interface f0/3
S1(config-if)# switchport mode access

Preparasi Router R1
Router(config)# hostname R1
R1(config)# interface f0/0
R1(config-if)# no shutdown
R1(config)# interface f0/0.10
R1(config-if)# encapsulation dot1Q 10
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# description subinterface_vlan10
R1(config-if)# interface f0/0.20
R1(config-if)# encapsulation dot1Q 20
R1(config-if)# ip address 192.168.20.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# description subinterface_vlan20
R1(config-if)# interface fa0/1
R1(config-if)# ip address 192.168.30.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# router ospf 1
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# network 192.168.20.0 0.0.0.255 area 0
R1(config-router)# network 192.168.30.0 0.0.0.255 area 0
R1(config-router)# exit
R1(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
R1(config)# ip dhcp excluded-address 192.168.20.1 192.168.20.10
R1(config)# ip dhcp pool LAN10
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 192.168.40.2
R1(dhcp-config)# exit
R1(config)# ip dhcp pool LAN20
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 192.168.40.2
R1(dhcp-config)# exit
R1(config)#

Preparasi Router R2
Router# conf t
Router(config)# hostname R2
R2(config)# interface fa0/0
R2(config-if)# ip address 192.168.30.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# description to_R1
R2(config-if)# exit
R2(config)# interface fa0/1
R2(config-if)# ip address 192.168.40.1 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# description to_Server0
R2(config-if)# exit
R2(config)# router ospf 1
R2(config-router)# network 192.168.40.0 0.0.0.255 area 0
R2(config-router)# network 192.168.30.0 0.0.0.255 area 0
R2(config-router)# exit

Sekarang test PC0 dan PC1 sudah bisa dapat alamat IP DHCP apa belum. Seharusnya sih sudah.

Skenario 2: DHCP servernya dipindah, bukan lagi R1 tapi Server0 sekarang yang jadi DHCP server.

Preparasi router R1
R1(config)# no ip dhcp pool LAN10
R1(config)# no ip dhcp pool LAN20
R1(config)# interface f0/0.10
R1(config-subif)# ip helper-address 192.168.40.2
R1(config-subif)# exit
R1(config)# interface fa0/0.20
R1(config-subif)# ip helper-address 192.168.40.2
R1(config-subif)# exit

Set up Server0
Klik icon Server0 pada packet tracer, pada tab Config, klik DHCP, isi data berikut:
Pool Name: PoolLAN10
Default Gateway: 192.168.10.1
DNS Server: 192.168.40.2
Start IP address: 192.168.10.100
Subnet mask: 255.255.255.0

Kemudian klik tombol Add.

Untuk pool yang kedua isi data berikut:
Pool Name: PoolLAN20
Default Gateway: 192.168.20.1
DNS Server: 192.168.40.2
Start IP address: 192.168.20.100
Subnet mask: 255.255.255.0

Kemudian klik tombol Add.
 
Sekarang test PC0 dan PC1 sudah bisa dapat alamat IP DHCP apa belum. Seharusnya sih sudah.

Well done, ente dah bisa ngonfig DHCP server dan DHCP relay pada Cisco IOS

No comments:

Post a Comment