stp的基础配置
原理
1)BPDU bridge protocol data unit 桥协议数据单元
运行了生成树协议的交换机彼此之间用来交流生成树信息的数据包
类型:
配置BPDU :详细介绍生成树的基本信息拓扑变更BPDU:把生成树的变化信息告诉别的交换机
内容:
根网桥的网桥ID、自己的网桥ID、到根网桥的成本、端口ID
2)stp端口状态
生成树选举需要一定的时间和过程:stp收敛
收敛:设备从不稳定到稳定的过程
禁用disabled强制关闭阻塞blocking不能转发数据帧,可以接收BPDU; 侦听listening不能转发数据帧,可以发送和接收BPDU; 学习leraning构建MAC地址表转发forwarding转发数据帧
3)STP计时器
hello时间:2s,交换机发送BPDU的频率和周期
max-age(最大老化时间):20s, 表示的是交换机的接口如果在指定时间没有接收到
BPDU的更新,那就把原来BPDU信息删除;
forward-relay(转发延迟):15s
侦听---->学习15s学习---->转发15s
拓扑图
配置命令
sw1
<Huawei>sys[Huawei]sys[Huawei]sysnamesw1[sw1]disstp-------[CISTGlobalInfo][ModeMSTP]-------CISTBridge :32768.4c1f-ccf6-5fa1ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/200000CISTRegRoot/IRPC :32768.4c1f-ccf6-5fa1/0CISTRootPortId :128.1BPDU-Protection :DisabledTCorTCNreceived :5TCcountperhello :0STPConvergeMode :NormalTimesincelastTC :0days0h:31m:2sNumberofTC :3[sw1]stpmodestpInfo: Thisoperationmaytakeafewseconds. Pleasewaitforamoment...done. [sw1]disstp-------[CISTGlobalInfo][ModeSTP]-------CISTBridge :32768.4c1f-ccf6-5fa1ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/200000CISTRegRoot/IRPC :32768.4c1f-ccf6-5fa1/0CISTRootPortId :128.1BPDU-Protection :DisabledTCorTCNreceived :5TCcountperhello :0STPConvergeMode :NormalTimesincelastTC :0days0h:31m:34sNumberofTC :3LastTCoccurred :Ethernet0/0/1[sw1]displaystpbriefMSTIDPortRoleSTPStateProtection0Ethernet0/0/1ROOTFORWARDINGNONE0Ethernet0/0/2ALTEDISCARDINGNONE[sw1]quit<sw1>displaybridgemac-addressSystembridgeMACaddress: 4c1f-ccf6-5fa1<sw1>
sw2
<Huawei>utm<Huawei>sys[Huawei]sys[Huawei]sysnamesw2[sw2]disstp-------[CISTGlobalInfo][ModeMSTP]-------CISTBridge :32768.4c1f-cc14-43f4ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/0CISTRegRoot/IRPC :32768.4c1f-cc14-43f4/0CISTRootPortId :0.0BPDU-Protection :DisabledTCorTCNreceived :5TCcountperhello :0STPConvergeMode :NormalTimesincelastTC :0days0h:31m:4sNumberofTC :5LastTCoccurred :Ethernet0/0/3----[Port1(Ethernet0/0/1)][FORWARDING]----PortProtocol :Enabled [sw2]stpmodestpInfo: Thisoperationmaytakeafewseconds. Pleasewaitforamoment...done. [sw2]disstp-------[CISTGlobalInfo][ModeSTP]-------CISTBridge :32768.4c1f-cc14-43f4ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/0CISTRegRoot/IRPC :32768.4c1f-cc14-43f4/0CISTRootPortId :0.0BPDU-Protection :DisabledTCorTCNreceived :5TCcountperhello :0STPConvergeMode :Normal[sw2]displaystpbriefMSTIDPortRoleSTPStateProtection0Ethernet0/0/1DESIFORWARDINGNONE0Ethernet0/0/3DESIFORWARDINGNONE[sw2]displaybridgemac-addressSystembridgeMACaddress: 4c1f-cc14-43f4[sw2]
sw3
<Huawei>sys[Huawei]sysnamesw3[sw3]disstp-------[CISTGlobalInfo][ModeMSTP]-------CISTBridge :32768.4c1f-cc96-3d85ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/200000CISTRegRoot/IRPC :32768.4c1f-cc96-3d85/0CISTRootPortId :128.3BPDU-Protection :DisabledTCorTCNreceived :2TCcountperhello :0STPConvergeMode :NormalTimesincelastTC :0days0h:31m:4sNumberofTC :4LastTCoccurred :Ethernet0/0/2[sw3]stpmodestpInfo: Thisoperationmaytakeafewseconds. Pleasewaitforamoment...done. [sw3]disstp-------[CISTGlobalInfo][ModeSTP]-------CISTBridge :32768.4c1f-cc96-3d85ConfigTimes :Hello2sMaxAge20sFwDly15sMaxHop20ActiveTimes :Hello2sMaxAge20sFwDly15sMaxHop20CISTRoot/ERPC :32768.4c1f-cc14-43f4/200000CISTRegRoot/IRPC :32768.4c1f-cc96-3d85/0CISTRootPortId :128.3BPDU-Protection :DisabledTCorTCNreceived :3TCcountperhello :0STPConvergeMode :Normal<sw3>displaystpbriefMSTIDPortRoleSTPStateProtection0Ethernet0/0/2DESIFORWARDINGNONE0Ethernet0/0/3ROOTFORWARDINGNONE<sw3>display<sw3>displaybr<sw3>displaybridgemac<sw3>displaybridgemac-addressSystembridgeMACaddress: 4c1f-cc96-3d85<sw3>