1、实验拓扑
2、测试
1)此时,LSW1为根桥。我们修改stp的根桥,备份根桥。
LSW1:
stp mode stp
stp pathcost-standard legacy
stp root primary
LSW2:
stp mode stp
stp pathcost-standard legacy
stp root secondary
查看LSW1、LSW2、LSW3的stp端口角色。e口的legacy标准的全双工cost值为199。g口的为20。
LSW1:
stp更改为root primary之后,它的优先级变为0。与命令stp priority 0 的作用一样。
LSW2:默认情况下,优先级是32768.
LSW3:
stp更改为root secondary之后,它的优先级变为4096。
2)更改cost值,重新查看接口角色。
LSW1:将接口E0/0/1的cost更改为300。
LSW2:
当E0/0/1的cost修改为300,E0/0/1到根桥的cost为300,E0/0/2到根桥的cost为199+20=219。E0/0/2的开销小,所以选择E0/0/2为根桥。
LSW3:
E0/0/2的cost为300+199=499,G0/0/1的cost为20。G0/0/1的开销小,故为根桥。
在LSW2连接LSW3的链路上,LSW 2的E0/0/1到根桥的cost为300,E0/0/2的cost为20,所以选择LSW 2的E0/0/1为阻塞端口,LSW3的G0/0/1为指定端口。
3)恢复LSW2的E0/0/1口的cost为199。设置LSW3的G0/0/1口为600。
LSW1:
interface Ethernet0/0/1
stp cost 199
LSW3:
interface GigabitEthernet0/0/1
stp cost 600
查看各个交换机端口角色。
LSW1:根桥的两个接口都是指定端口。
LSW2:E0/0/1的cost值为199,E0/0/2的cost值为600+199=799。故E0/0/1口为根端口。
LSW3:E0/0/2口的cost为199+199=398,G0/0/1口的cos值为600。故小的E0/0/2口为根端口。
在LSW2连接LSW3的链路上,LSW 2的E0/0/2到根桥的cost为199,为指定端口。LSW3的的G0/0/1的cost为600,被阻塞掉,为备份端口。