[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
STP是用来避免数据链路层出现逻辑环路的协议,运行STP协议的设备通过交互信息发现环路,并通过阻塞特定端口,最终将网络结构修剪成无环路的树形结构。
STP配置及选举规则拓扑图如下:
其中S1作为主根交换机,S2作为S1的备根交换机。同时对于S4交换机,E0/0/1为根端口,S2的E0/0/3为根端口,将S3与它相连的PC机的端口定义为边缘端口,避免测试电脑上下线对网络产生的影响。
主要配置如下:
首先基础配置,在每个交换机上输入一下命令:
然后使用display stp 查看生成树状态
还可以使用display stp brief 命令查看摘要信息
使用stp priority 0(优先级)设置交换机的优先级
使用stp root primary 命令配置主根交换机
使用stp root secondary命令配置备份根交换机
设置根端口:
使用display stp brief 命令查看摘要信息
花费小便是根端口,这里可以看出Ethernet0/0/1为根端口,如果想设置Ethernet0/0/2为根端口,只需要将2的端口花费比1端口的小即可
使用display stp interface Ethernet0/0/1,可以查看路径开销,
然后interface Ethernet0/0/1,
stp cost 2000(开销)即可设置路径开销,这里举例设置为2000
设置指定端口和根端口一样。这里就不演示了。