源设备名称 | 设备端口 | 端口描述 | 目标设备名称 |
---|---|---|---|
LSW1 | g0/0/1 | 无 | LSW2 |
LSW1 | g0/0/2 | 无 | LSW3 |
LSW2 | g0/0/1 | 无 | LSW1 |
LSW2 | g0/0/2 | 无 | LSW3 |
LSW2 | e0/0/1 | 无 | PC1 |
LSW3 | g0/0/1 | 无 | LSW1 |
LSW3 | g0/0/2 | 无 | LSW2 |
LSW3 | e0/0/1 | 无 | PC2 |
PC1 | e0/0/1 | 无 | LSW2 |
PC2 | e0/0/1 | 无 | LSW3 |
注意:数据是从PC机里出来,到达最顶部的LSW1
1、搭好拓扑结构
2、双击LSW1,将LSW1改名为S1,设置该机器的stp模式为rstp
xxxxxxxxxx
sys
un in en
sys S1
stp mode rstp
3、双击LSW2,将LSW2改名为S2,设置该机器的stp模式为rstp
xxxxxxxxxx
sys
un in en
sys S2
stp mode rstp
4、双击LSW3,将LSW3改名为S3,设置该机器的stp模式为rstp
xxxxxxxxxx
sys
un in en
sys S3
stp mode rstp
5、双击S1,查询一下S1是否是根桥,即看弹出来的第一台信息和第四条信息是否相同,是则根桥
xxxxxxxxxx
dis stp
6、如果S1不是根桥,那么就设置S1为根桥,然后再次查询S1是否为根桥,结果是为根桥
xxxxxxxxxx
stp root primary
dis stp
7、双击S2,指定S2的g0/0/2端口为指定端口,先查询一下S2的g0/0/2端口是否是指定端口DESI
xxxxxxxxxx
dis stp brief
8、如果不是指定端口,那么就设置S2的g0/0/2为指定端口,然后再次查询即可。 思路:把LSW3的g0/0/1端口的开销增大,这样通过LSW3的数据就只能从LSW3的g0/0/2端口出去, 此时LSW3的g0/0/2端口就是LSW3的根端口,该根端口的对端就是指定端口,而对端恰好是LSW2的 g0/0/2端口,即此时LSW2的g0/0/2端口就是指定端口 操作:双击LSW3,增加LSW3的g0/0/1端口的开销值cost(注意g端口的开销值默认值是2万),如下:
xxxxxxxxxx
sys
int g0/0/1
stp cost 200000
9、如何再次查询S2的g0/0/2端口是否已经为指定端口,双击S2
xxxxxxxxxx
sys
dis stp brief
可以发现此时S2的g0/0/2端口的Role列已经为DESI,即已经为指定端口
10、所有连接PC的端口都配置为边缘端口,即LSW2的e0/0/1端口、LSW3的e0/0/1端口 双击LSW2,即先配置LSW2的e0/0/1端口为指定端口
xxxxxxxxxx
sys
int e0/0/1
stp edged-port enable
查看LSW2的e0/0/1端口是否已经为指定端口
xxxxxxxxxx
dis current
双击LSW3,即接着继续配置LSW3的e0/0/1端口为指定端口
xxxxxxxxxx
sys
int e0/0/1
stp edged-port enable
查看LSW3的e0/0/1端口是否已经为指定端口
xxxxxxxxxx
dis current
11、查询相关的STP信息,标出端口角色和端口状态。例如我们以S1为例,双击S1,即双击LSW1
xxxxxxxxxx
sys
查询生成树
xxxxxxxxxx
dis stp brief
弹出来的Role列就是端口角色列,例如:指定|堵塞|边缘 State列就是状态列,例如:FORWARDING即表示为转发状态|DISCARDING即表示为不能正常转发数据