Packet Tracer VLAN: Różnice pomiędzy wersjami
Linia 73: | Linia 73: | ||
Switch(config)#vlan 3 | Switch(config)#vlan 3 | ||
Switch(config-vlan)#name VLAN3 | Switch(config-vlan)#name VLAN3 | ||
+ | Switch(config)#exit | ||
+ | </pre> | ||
+ | |||
+ | Przypisujemy porty do vlanów. | ||
+ | |||
+ | <pre> | ||
+ | Switch(config)#interface fastethernet0/1 | ||
+ | Switch(config-if)#switchport access vlan 2 | ||
+ | Switch(config-if)#exit | ||
+ | Switch(config)#int fa3/1 | ||
+ | Switch(config-if)#switchport access vlan 2 | ||
+ | Switch(config-if)#int eth4/1 | ||
+ | Switch(config-if)#switchport access vlan 2 | ||
+ | Switch(config-if)#exit | ||
+ | Switch(config)#int fa1/1 | ||
+ | Switch(config-if)#switchport access vlan 3 | ||
+ | Switch(config-if)#exit | ||
+ | Switch(config)#int fa2/1 | ||
+ | Switch(config-if)#switchport access vlan 3 | ||
+ | Switch(config-if)#exit | ||
</pre> | </pre> | ||
Wersja z 11:42, 15 sty 2014
W programie Packet Tracer stworzymy lokalne sieci wirtualne czyli VLANy.
Mamy zwykłą sieć LAN. Komputery są odpowiednio skonfigurowane do pracy w sieci.
Konfigurowanie VLANów poprzez GUI Packet Tracer
Jak widać na tablicy przełączania komputery się "widzą". Należą do jednego VLANu.
Na switchu dodajemy 2 sieci wirtualne, VLAN1 i VLAN2
Przypisujemy porty switcha do odpowiednich VLANów
Jak widać komputery z różnych sieci wirtualnych nie widzą się. Pingi nie przechodzą.
Konfigurowanie VLANów poprzez CLI
Sprawdzamy jakie posiadamy VLANy na przełączniku. Służy do tego polecenie show vlan
Switch>enable Switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa1/1, Fa2/1, Fa3/1 Eth4/1, Eth5/1 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs ------------------------------------------------------------------------------ Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ Switch#
Jak widać wszystkie porty należą do vlanu 1, czyli wszystkie podpięte hosty powinny się komunikować (oczywiście, jeśli zostały nadane adresy IP).
Dodamy dwa vlany o numerach 2 i 3 oraz nadamy im nazwy VLAN2 i VLAN3. We wcześniejszym przykładzie vlan2 nazywa się VLAN1 a vlan3 VLAN2, przypominam, aby nie było pomyłki przy porównywaniu zrzutów.
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#name VLAN2 Switch(config-vlan)#exit Switch(config)#vlan 3 Switch(config-vlan)#name VLAN3 Switch(config)#exit
Przypisujemy porty do vlanów.
Switch(config)#interface fastethernet0/1 Switch(config-if)#switchport access vlan 2 Switch(config-if)#exit Switch(config)#int fa3/1 Switch(config-if)#switchport access vlan 2 Switch(config-if)#int eth4/1 Switch(config-if)#switchport access vlan 2 Switch(config-if)#exit Switch(config)#int fa1/1 Switch(config-if)#switchport access vlan 3 Switch(config-if)#exit Switch(config)#int fa2/1 Switch(config-if)#switchport access vlan 3 Switch(config-if)#exit
CDN