
1.3.1 任务一:STP技术配置
【任务描述】
为了提高网络的可靠性,在交换机SWA和SWB上用两条链路实现互联,以增加网络骨干链路的带宽,运行STP,使网络避免环路。其网络拓扑结构如图1-15所示。

图1-15 STP技术配置的网络拓扑结构
【任务实施】
1.在交换机SWA和SWB上配置STP
(1)在交换机SWA上配置STP

(2)在交换机SWB上配置STP

2.指定交换机SWA为根交换机

3.查看交换机及端口的状态
(1)查看交换机SWA上配置的STP

上述show命令输出结果显示交换机SWA没有根端口,路径开销为0,是根交换机。
(2)查看交换机SWB上配置的STP

上述show命令输出结果显示交换机SWB为非根交换机,到根交换机的路径开销为200000,根端口为F0/3。
(3)查看交换机SWB端口F0/3和F0/4的状态


上述show命令输出结果显示交换机SWB为非根交换机,到根交换机的路径开销为200000,根端口为F0/3。

上述show命令输出结果显示交换机SWB的端口F0/4为替换端口。
(4)如果交换机SWA与SWB的端口F0/3之间的链路down掉,验证交换机SWB的端口F0/4的状态


上述show命令输出结果显示交换机SWB为非根交换机,到根交换机的路径开销为200000,根端口为F0/4。
4.验证测试
按图1-15所示连接拓扑,将PC1的IP地址设置为192.168.1.10/24,将PC2的IP地址设置为192.168.1.20/24。在PC1和PC2相通的情况下,让交换机SWA与SWB之间的端口F0/3所连接备用链路down掉(如拔掉网线),验证PC1与PC2是否能够ping通,并观察ping的丢包情况。

从ping命令的输出结果可以看到,把端口F0/3所连接的主链路down掉,PC1与PC2之间仍然能够ping通,说明备用链路(端口F0/4所连接链路)已经启用,但是在链路切换过程中有丢包现象。