Pada halaman sebelumnya kita telah membahas VLAN. Nah sekarang kita akan membahas tentang sahabatnya yaitu trunks. Apa itu trunks? Jadi, Trunk adalah link atau koneksi antara dua switch yang memungkinkan banyak VLAN ditransmisikan secara bersamaan melalui satu link fisik. Penggunkan trunks ini dapat mengurangi jumlah kabel yang dibutuhkan dan meminimalkan biaya infrastruktur jaringan.
Sebelum masuk ke konfigurasi maro kita lihat syntax-nya terlebih dauhulu
Command | Description |
---|---|
S1(config)#interface [int-id] |
Masuk mode interface |
S1(config-if)#switchport mode trunk |
menset interface ke mode trunk |
S1(config-if)#switchport trunk native vlan [vlan-id] |
- |
S1(config-if)#switchport trunk allowed vlan [vlan-list] |
allowed VLAN IDs. all untuk allow semua vlan |
S1(config-if)#switchport trunk allowed vlan remove [vlan-id] |
Menghilangkan akses vlan pada trunk |
Command | Description |
---|---|
S1#show interfaces trunk |
Menlist vlan id yang terallow dalam suatu links trunks |
Pada toplogy terdapat 2 jaringan yang berbeda yaitu BIRU : 192.168.1.0/24
dengan VLAN 10 dan MAGENTA : 192.168.2.0/24
dengan VLAN 20. Interface gigabitethernet0/1 akan menjadi links trunks yang mengubungkan vlan atas dan bawah.
host | VLAN |
---|---|
PC1,PC2,PC5,PC6 | VLAN10 |
PC3,PC4,PC7,PC8 | VLAN20 |
SW1(config)#vlan 10
SW1(config-vlan)#name BIRU
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name MAGENTA
SW1(config-vlan)#exit
SW2(config)#vlan 10
SW2(config-vlan)#name BIRU
SW2(config-vlan)#exit
SW2(config)#vlan 20
SW2(config-vlan)#name MAGENTA
SW2(config-vlan)#exit
SW1(config)#interface range f0/1-2
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 10
SW1(config)#interface range f0/3-4
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 20
SW2(config)#interface range f0/1-2
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 10
SW2(config-if-range)#exit
SW2(config)#interface range f0/3-4
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 20
sebelum konfigurasi trunks mari kita cek terlebih dahulu koneksifitas sebrang links. PC1 - PC6
C:\>ipconfig
FastEthernet0 Connection:(default port)
Connection-specific DNS Suffix..:
Link-local IPv6 Address.........: FE80::290:2BFF:FE64:B4BB
IPv6 Address....................: ::
IPv4 Address....................: 192.168.1.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: ::
0.0.0.0
Bluetooth Connection:
Connection-specific DNS Suffix..:
Link-local IPv6 Address.........: ::
IPv6 Address....................: ::
IPv4 Address....................: 0.0.0.0
Subnet Mask.....................: 0.0.0.0
Default Gateway.................: ::
0.0.0.0
C:\>ping 192.168.1.4
Pinging 192.168.1.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Semua packet loss
Menset interface ke mode trunks. Untuk alasan keamaan kita hanya akan menijinkan vlan 10 dan 20.
SW1(config)#interface g0/1
SW1(config-if)#switchport mode trunk
SW1(config-if)#do show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 1-1005
Port Vlans allowed and active in management domain
Gig0/1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 1,10,20
SW1(config-if)#switchport trunk allowed vlan 10,20
SW1(config-if)#do show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 10,20
Port Vlans allowed and active in management domain
Gig0/1 10,20
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 20
SW1(config-if)#exit
SW2(config)#interface g0/1
SW2(config-if)#switchport mode trunk
SW2(config-if)#switchport trunk allowed vlan 10,20
SW2(config-if)#
C:\>ping 192.168.1.4
Pinging 192.168.1.4 with 32 bytes of data:
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.1.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.2.4
Pinging 192.168.2.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.2.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>ping 192.168.1.4
Pinging 192.168.1.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>ping 192.168.2.4
Pinging 192.168.2.4 with 32 bytes of data:
Reply from 192.168.2.4: bytes=32 time<1ms TTL=128
Reply from 192.168.2.4: bytes=32 time<1ms TTL=128
Reply from 192.168.2.4: bytes=32 time<1ms TTL=128
Reply from 192.168.2.4: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.2.4:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms