Konfigurasi VLAN di cisco packet tracer 2
Untuk melakukan konfigurasi VLAN pada Switch Cisco Catalyst, berikut ini adalah sintaks konfigurasinya :
- Pertama kita buat VLAN 10 dan 20 pada Switch, dan berikan nama jika diperlukan.
Switch>en
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name afiyanto
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name udin
Switch(config-vlan)#exit
Switch(config)#do sh vlan
- Masukkan interface-nya.
Switch(config)#int range fa0/1-2
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config)#int range fa0/3-4
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
- Masuk switch yang di bawah-nya, lalu buat vlan tanpa interface.
Switch(config)#vlan 10
Switch(config-vlan)#name afiyanto
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name udin
Switch(config-vlan)#exit
Switch(config)#do sh vlan
- Tambahkan ip pada router 1
Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int gigabitEthernet 0/0
Router(config-if)#ip add 192.168.60.65 255.255.255.192
Router(config-if)#no sh
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int gigabitEthernet 0/1
Router(config-if)#ip add 192.168.5.7 255.255.255.128
Router(config-if)#no sh
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Router(config-if)#exit
- Tambahkan ip gateway untuk vlan 10 dan 20.
Router(config)#int 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
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.10.33 255.255.255.224
Router(config-subif)#no sh
Router(config-subif)#exit
Router(config)#int 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
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip add 192.168.60.65 255.255.255.224
Router(config-subif)#no sh
Router(config-subif)#exit
- Masuk ke switch di sebelah-nya, set menjadi mode trunk.
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/3
Switch(config-if)#sw
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode tru
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up
Switch(config-if)#exit
Switch(config)#int fa0/1
Switch(config-if)#sw
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode tr
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up
Switch(config-if)#exit
- Ganti ke switch yang atas.
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#sw
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode tru
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up
Switch(config-if)#exit
- Masuk router 2, tambahkan ip.
Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int gigabitEthernet 0/0
Router(config-if)#ip add 192.168.10.10 255.255.255.0
Router(config-if)#no sh
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int gigabitEthernet 0/1
Router(config-if)#ip add 192.168.5.6 255.255.255.128
Router(config-if)#no sh
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Router(config-if)#exit
- Masuk ke switch 2, lalu buat vlan.
Switch>en
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#name adib
Switch(config-vlan)#exit
Switch(config)#vlan 40
Switch(config-vlan)#name lutfi
Switch(config-vlan)#exit
Switch(config)#do sh vlan
- Masukkan interface-nya.
Switch(config)#int range fa0/1-2
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 30
Switch(config)#int range fa0/3-4
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 40
- Masuk ke router 2, tambahkan ip gateway untuk vlan 30 dan 40.
Router(config)#int gigabitEthernet 0/0.30
%LINK-5-CHANGED: Interface GigabitEthernet0/0.30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.30, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip add 192.168.30.33 255.255.255.240
Router(config-subif)#no sh
Router(config-subif)#exit
Router(config)#int gigabitEthernet 0/0.40
%LINK-5-CHANGED: Interface GigabitEthernet0/0.40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.40, changed state to up
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 40
Router(config-subif)#ip add 192.168.40.49 255.255.255.240
Router(config-subif)#no sh
Router(config-subif)#exit
- Masuk ke switch, set ke mode trunk.
Switch#conf
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/5
Switch(config-if)#sw
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode tru
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up
Switch(config-if)#exit
- Masuk ke router 1, routing router-nya.
ip route 192.168.30.32 255.255.255.240 192.168.5.6
ip route 192.168.40.48 255.255.255.240 192.168.5.6
ip route 192.168.10.0 255.255.255.0 192.168.5.6
- Masuk ke router 2, lakukan routing lagi.
ip route 192.168.60.64 255.255.255.224 192.168.5.7
ip route 192.168.20.64 255.255.255.192 192.168.5.7
- Test ping dari PC ke PC dan PC ke Server.