stp的基础配置

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]sysname sw1
[sw1]dis stp  
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge         :32768.4c1f-ccf6-5fa1
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 200000
CIST RegRoot/IRPC   :32768.4c1f-ccf6-5fa1 / 0
CIST RootPortId     :128.1
BPDU-Protection     :Disabled
TC or TCN received  :5
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:31m:2s
Number of TC        :3

[sw1]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]dis stp 
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :32768.4c1f-ccf6-5fa1
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 200000
CIST RegRoot/IRPC   :32768.4c1f-ccf6-5fa1 / 0
CIST RootPortId     :128.1
BPDU-Protection     :Disabled
TC or TCN received  :5
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:31m:34s
Number of TC        :3
Last TC occurred    :Ethernet0/0/1

[sw1]display stp brief 
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/1               ROOT  FORWARDING      NONE
   0    Ethernet0/0/2               ALTE  DISCARDING      NONE
[sw1]quit 
<sw1>display bridge mac-address 
System bridge MAC address: 4c1f-ccf6-5fa1
<sw1>

sw2
<Huawei>u t m 
<Huawei>sys 
[Huawei]sys
[Huawei]sysname sw2 
[sw2]dis stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge         :32768.4c1f-cc14-43f4
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 0
CIST RegRoot/IRPC   :32768.4c1f-cc14-43f4 / 0
CIST RootPortId     :0.0
BPDU-Protection     :Disabled
TC or TCN received  :5
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:31m:4s
Number of TC        :5
Last TC occurred    :Ethernet0/0/3
----[Port1(Ethernet0/0/1)][FORWARDING]----
 Port Protocol       :Enabled
  
 [sw2]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]dis stp 
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :32768.4c1f-cc14-43f4
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 0
CIST RegRoot/IRPC   :32768.4c1f-cc14-43f4 / 0
CIST RootPortId     :0.0
BPDU-Protection     :Disabled
TC or TCN received  :5
TC count per hello  :0
STP Converge Mode   :Normal 

[sw2]display  stp brief 
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/1               DESI  FORWARDING      NONE
   0    Ethernet0/0/3               DESI  FORWARDING      NONE
[sw2]display bridge mac-address 
System bridge MAC address: 4c1f-cc14-43f4
[sw2]
sw3
<Huawei>sys
[Huawei]sysname sw3
[sw3]dis stp
-------[CIST Global Info][Mode MSTP]-------
CIST Bridge         :32768.4c1f-cc96-3d85
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 200000
CIST RegRoot/IRPC   :32768.4c1f-cc96-3d85 / 0
CIST RootPortId     :128.3
BPDU-Protection     :Disabled
TC or TCN received  :2
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:31m:4s
Number of TC        :4
Last TC occurred    :Ethernet0/0/2

[sw3]stp mode stp
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3]dis stp 
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :32768.4c1f-cc96-3d85
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :32768.4c1f-cc14-43f4 / 200000
CIST RegRoot/IRPC   :32768.4c1f-cc96-3d85 / 0
CIST RootPortId     :128.3
BPDU-Protection     :Disabled
TC or TCN received  :3
TC count per hello  :0
STP Converge Mode   :Normal 

<sw3>display stp brief 
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/2               DESI  FORWARDING      NONE
   0    Ethernet0/0/3               ROOT  FORWARDING      NONE
<sw3>display
<sw3>display br
<sw3>display bridge mac
<sw3>display bridge mac-address 
System bridge MAC address: 4c1f-cc96-3d85
<sw3>
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不懂说安全

创作不易您打赏是对我最大的鼓励

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值