STP
实验拓扑
实验需求
- 开启所有设备,等待STP收敛后观察STP状态
- 使SW4成为根网桥
- 使闭塞端口出现在SW2上
- 把SW1上连接的PC的端口配置为边缘端口
实验步骤:
1.开启stp #交换机默认运行mstp
SW1
[sw1]stp mode stp #手动修改模式为stp
sw2
[sw2]stp mode stp
sw3
[sw3]stp mode stp
sw4
[sw4]stp mode stp
sw1
[sw1]dis int GigabitEthernet 1/0/4 #查看接口
GigabitEthernet1/0/4
Current state: DOWN
Line protocol state: DOWN
IP packet frame type: Ethernet II, hardware address: 409e-e6a0-0100 #本机的mac地址
Description: GigabitEthernet1/0/4 Interface
Bandwidth: 1000000 kbps
##查看完所有mac(优先级都是默认的),可以看到sw4<sw3<sw2<sw1
##所以 可以得知sw1为根,到时候sw4上会有一个蔽塞端口(AP)
观察STP状态
sw1
[sw1]dis stp
-------[CIST Global Info][Mode STP]-------
Bridge ID : 32768.409e-e6a0-0100
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 32768.409e-e6a0-0100, 0 #可以看出根为自己
RegRoot ID/IRPC : 32768.409e-e6a0-0100, 0
RootPort ID : 0.0
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 4
Time since last TC : 0 days 0h:14m:13s
sw4
[sw4]dis stp
-------[CIST Global Info][Mode STP]-------
Bridge ID : 32768.409f-0322-0400
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 32768.409e-e6a0-0100, 40 #根为sw1
RegRoot ID/IRPC : 32768.409f-0322-0400, 0
RootPort ID : 128.2
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 20