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

图1-16 RSTP技术配置的网络拓扑结构
【任务实施】
1.在交换机SWA和SWB上完成Trunk链路配置
(1)在交换机SWA上完成Trunk配置

(2)在交换机SWB上完成Trunk配置

2.在交换机SWA和SWB上配置RSTP
(1)在交换机SWA上配置STP

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

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

4.查看交换机及端口的状态


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

上述show命令输出结果显示交换机SWB的端口为F0/1角色为根端口,处于转发状态。


上述show命令输出结果显示交换机SWB的端口F0/2为替换端口,状态为阻塞状态。
5.设置交换机SWB的端口F0/2为根端口

6.查看交换机及端口的状态


上述show命令输出结果显示交换机SWA为根交换机。

上述show命令输出结果显示交换机SWB的端口F0/2为根端口,处于转发状态。
7.验证测试
按图1-16所示连接拓扑,将PC1的IP地址设置为192.168.1.10/24,将PC2的IP地址设置为192.168.1.20/24。
(1)让交换机SWA与SWB之间的端口F0/1所连接备用链路down掉(如拔掉网线),观察PC1 ping PC2结果


(2)重新接上端口F0/1所连接链路,待网络稳定后,让交换机SWA与SWB之间的端口F0/2所连接主链路down掉,观察PC1 ping PC2结果

以上结果显示丢包数为一个。
【小结】
通过生成树技术的学习,主要掌握STP、RSTP等配置与管理工作。
STP通过逻辑上阻塞一些冗余端口来消除环路,将物理环路改变为逻辑上无环路的拓扑,而一旦活动链路故障,被阻塞的端口能够立即启用,以达到冗余备份的目的。