Cisco Packet Tracer - VLAN trunking

Z Systemy operacyjne i sieci komputerowe
Przejdź do nawigacji Przejdź do wyszukiwania


VLAN Trunking

Służy do łączenia sieci VLAN na poszczególnych przełącznikach. Porty łączące switche ustawiamy w trybie trunk


Konfigurowanie VLANów poprzez GUI Packet Tracer

Vlantrunk1.png

Jak widać mamy na dwóch przełącznikach skonfigurowane VLANy 10 i 11. Aby mogło dojść do komunikacji między przełącznikami, musimy ustawić na portach łączących oba switche tryb trunk

Bez tego komputery, mimo że są w tych samych VLANach komunikować się nie będą. Patrz obrazek poniżej.

Vlantrunk2.png

Ustawimy teraz tryb trunk, który umożliwi nam komunikację.

Vlantrunk3.png

Analogiczne ustawienia robimy na drugim przełączniku.

Vlantrunk4.png

Jak widać teraz komunikacja przebiegła bez zakłóceń.

Konfigurowanie VLANów poprzez CLI

Wpisujemy na obu przełącznikach. Wpisy mogą różnić się interfejsem, bo niekoniecznie na obu musi być fa4/1.

Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fastethernet4/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan add 10
Switch(config-if)#switchport trunk allowed vlan add 11
Switch(config-if)#end
Switch#

Omówienie powyższych linii.

switchport mode trunk włączenie na porcie trybu trunk.

switchport trunk allowed vlan add 10 dodanie VLAN 10 do łącza trunk

Inne polecenia

Oczywiście dodawanie większej liczby VLANów w ten sposób jest problematyczne. Można wówczas użyć switchport trunk allowed vlan 10-1001 albo switchport trunk allowed vlan 10,11,30

show interface switchport sprawdzenie informacji o interfejsach z przypisanym trybem access i trunk.

Interfejs Fa3/1 jest w trybie access i przypisany jest do VLANu 11 o nazwie biuro. Natomiast interfejs Fa4/1 jest w trybie trunk i łączy VLANy 10 i 11.

Name: Fa3/1
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: On
Access Mode VLAN: 11 (biuro)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none

Name: Fa4/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: 10-11
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none


switchport trunk allowed vlan remove 10 Tu przykład usunięcia VLANu 10 z łącza trunk

no switchport mode trunk Usunięcie trybu trunk.