Router on stick as dhcp server

Pada postingan sebelumny saya sudah membahas vlan dan vlan trunking pada switch, lalu bagaimana jika kita ingin agar vlan dapat saling terhubung walaupun berbeda network? jawabannya adalah dengan menambahkan router. Tapi kan vlan menggunakan protokol dot1Q? Ya, di router anda dapat menggunakan enkapsulasi dot1Q. Mari kita ngelab!

Topologi

router on stick

Konfigurasi IDN-Router

IDN-Router(config)#int fa0/1
IDN-Router(config-if)#no shutdown

IDN-Router(config-if)#int fa0/1.10
IDN-Router(config-if)#encapsulation dot1q 10
IDN-Router(config-if)#ip addr 10.10.10.1

IDN-Router(config-if)#int fa0/1.20
IDN-Router(config-if)#encapsulation dot1q 20
IDN-Router(config-if)#ip addr 20.20.20.1
IDN-Router(config)#ip dhcp pool vlan-10
IDN-Router(dhcp-config)#network 10.10.10.0 255.255.255.0
IDN-Router(dhcp-config)#default-router 10.10.10.1
IDN-Router(dhcp-config)#dns-server 8.8.8.8
IDN-Router(dhcp-config)#exit

IDN-Router(config)#ip dhcp pool vlan-20
IDN-Router(dhcp-config)#network 20.20.20.0 255.255.255.0
IDN-Router(dhcp-config)#default-router 20.20.20.1
IDN-Router(dhcp-config)#dns-server 8.8.8.8
IDN-Router(dhcp-config)#exit

Konfigurasi IDN-Switch1

IDN-Switch1(config)#vlan 10
IDN-Switch1(config-vlan)#name IDN-VLAN10

IDN-Switch1(config)#vlan 20
IDN-Switch1(config-vlan)#name IDN-VLAN20
IDN-Switch1(config)#int range fa0/1, fa0/3
IDN-Switch1(config-if)#switchport mode trunk
IDN-Switch1(config-if)#exit

IDN-Switch1(config)#int fa0/2
IDN-Switch1(config-if)#switchport access vlan 10
IDN-Switch1(config-if)#exit

IDN-Switch1(config)#int fa0/4
IDN-Switch1(config-if)#switchport access vlan 20
IDN-Switch1(config-if)#exit

Konfigurasi IDN-Switch2

IDN-Switch2(config)#vlan 10
IDN-Switch2(config-vlan)#name IDN-VLAN10

IDN-Switch2(config)#vlan 20
IDN-Switch2(config-vlan)#name IDN-VLAN20
IDN-Switch2(config)#int fa0/1
IDN-Switch2(config-if)#switchport mode trunk
IDN-Switch2(config-if)#exit

IDN-Switch2(config)#int fa0/2
IDN-Switch2(config-if)#switchport access vlan 10
IDN-Switch2(config-if)#exit

IDN-Switch2(config)#int fa0/3
IDN-Switch2(config-if)#switchport access vlan 20
IDN-Switch2(config-if)#exit

Atur ip address setiap pc menjadi dhcp

image4144

** Lakukan pada setiap pc

Pengujian

Pada pc1

PC>ping 10.10.10.2

Pinging 10.10.10.2 with 32 bytes of data:

Reply from 10.10.10.2: bytes=32 time=1ms TTL=128
Reply from 10.10.10.2: bytes=32 time=0ms TTL=128
Reply from 10.10.10.2: bytes=32 time=0ms TTL=128
Reply from 10.10.10.2: bytes=32 time=0ms TTL=128

Ping statistics for 10.10.10.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC>ping 20.20.20.2

Pinging 20.20.20.2 with 32 bytes of data:

Request timed out.
Reply from 20.20.20.2: bytes=32 time=0ms TTL=127
Reply from 20.20.20.2: bytes=32 time=0ms TTL=127
Reply from 20.20.20.2: bytes=32 time=0ms TTL=127

Ping statistics for 20.20.20.2:

Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

Pada pc3

PC>ping 10.10.10.1

Pinging 10.10.10.1 with 32 bytes of data:

Reply from 10.10.10.1: bytes=32 time=1ms TTL=128
Reply from 10.10.10.1: bytes=32 time=0ms TTL=128
Reply from 10.10.10.1: bytes=32 time=1ms TTL=128
Reply from 10.10.10.1: bytes=32 time=0ms TTL=128

Ping statistics for 10.10.10.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC>ping 20.20.20.1

Pinging 20.20.20.1 with 32 bytes of data:

Request timed out.
Reply from 20.20.20.1: bytes=32 time=0ms TTL=127
Reply from 20.20.20.1: bytes=32 time=0ms TTL=127
Reply from 20.20.20.1: bytes=32 time=0ms TTL=127

Ping statistics for 20.20.20.1:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s