20201216 cisco VLAN

課堂資料

VLAN 的介绍

Switch
broadcast
採用"廣播方式"
multicast
採用"廣播方式"
Fwarding DB
採用"廣播方式"
VLAN TAG 包的 VLAN ID 號,有效範圍是1-4094,0 和 4095 都為協議保留值,VLAN ID 0 表示不屬於任何 VLAN。
1为系统默认 VLAN,即 Native VLAN。默认情况下,所有的接口都属于 VLAN1. 当交换机收到未带有 VLAN TAG 包的数据帧时,会将数据包转发至 Native VLAN 端口。
2-1001是普通的 VLAN,1006-1024保留仅系统使用,用户不能查看和使用,1002-1005是支持 fddi 和令牌环的 VLAN,1025-4095是扩展的 VLAN。

VLAN 802.1q

802.1q VLAN

VLAN VTP ( VLAN Trunking Protocol )

VTP mode

VTP
Server
能創建、刪除、修改 VLAN
Client
不能創建、刪除、修改 VLAN,能學習轉發
Transparent
能創建、刪除、修改 VLAN,不能學習轉發

課堂練習

VLAN 802.1q

Part 01.

VPC 2
VPC 3
VPC 4
VPC 5
SW
ip 192.168.1.1 255.255.255.0
ping 192.168.1.2
ping 192.168.1.3
ping 192.168.1.4
ip 192.168.1.2 255.255.255.0
ping 192.168.1.1
ping 192.168.1.3
ping 192.168.1.4
ip 192.168.1.3 255.255.255.0
ping 192.168.1.1
ping 192.168.1.2
ping 192.168.1.4
ip 192.168.1.4 255.255.255.0
ping 192.168.1.1
ping 192.168.1.2
ping 192.168.1.3
vlan 10
name Vlan10
exit
vlan 20
name Vlan20
do sh vlan brief
int e0/0
switchport mode access
switchport access vlan 10
int e0/1
switchport mode access
switchport access vlan 10
int e0/2
switchport mode access
switchport access vlan 20
int e0/3
switchport mode access
switchport access vlan 20
do sh vlan brief

Part 02.

VPC 2
VPC 3
SW 1
VPC 4
VPC 5
SW 2
ip 192.168.1.1 255.255.255.0
ping 192.168.1.2
ping 192.168.1.3
ping 192.168.1.4
ip 192.168.1.2 255.255.255.0
ping 192.168.1.1
ping 192.168.1.3
ping 192.168.1.4
vlan 10
name Vlan10
exit
vlan 20
name Vlan20
do sh vlan brief
int e0/0
switchport mode access
switchport access vlan 10
int e0/1
switchport mode access
switchport access vlan 20
int e0/2
switchport mode access
switchport access vlan 10
int e0/3
switchport mode access
switchport access vlan 20
do sh vlan brief
ip 192.168.1.3 255.255.255.0
ping 192.168.1.1
ping 192.168.1.2
ping 192.168.1.4
ip 192.168.1.4 255.255.255.0
ping 192.168.1.1
ping 192.168.1.2
ping 192.168.1.3
vlan 10
name Vlan10
exit
vlan 20
name Vlan20
do sh vlan brief
int range e0/0,e0/2
switchport mode access
switchport access vlan 10
int range e0/1,e0/3
switchport mode access
switchport access vlan 20
do sh vlan brief

VLAN VTP

Part 01.

sw1
sw2

VTP Server 設定

vtp domain mynet
vtp password cisco
do sh vtp status
do sh vtp password
vlan 11-15,1006
do sh vlan brief
int e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
do sh vlan brief

VTP Client 設定

vtp mode client
vtp domain mynet
vtp password cisco
do sh vtp status
do sh vlan brief
int e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
do sh vlan brief

Part 02.

sw1
sw2
sw3
no vlan 13
do sh vlan brief
no vlan 11
do sh vlan brief
vlan 20,21,22
do sh vlan brief
do sh vlan brief
no vlan 12
vlan 16
int e0/1
switchport trunk encapsulation dot1q
switchport mode trunk
do sh vlan brief
exit
vtp mode transparent
do sh vtp status
do sh vlan brief
vlan 30
do sh vlan brief
vtp mode client
vtp domain mynet
do sh vtp status
do sh vlan brief
int e0/0
switchport trunk encapsulation dot1q
switchport mode trunk
do sh vlan brief