H3CNE学习---STP、RSTP、MSTP生成树协议

一、STP生成树

  1、介绍

  

  2、stp的操作

  

  3、stp基本命令

[H3C]undo stp global enable                                         关闭stp
[H3C]stp priority 0                                                 修改stp优先级
<H3C>display stp                                                    查看stp基本信息
-------[CIST Global Info][Mode MSTP]-------
 Bridge ID           : 32768.6c39-795e-0300                         默认优先级(32768)+交换机mac地址
 Bridge times        : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
 Root ID/ERPC        : 32768.6c39-700e-0100, 20
 RegRoot ID/IRPC     : 32768.6c39-795e-0300, 0
 RootPort ID         : 128.2
 BPDU-Protection     : Disabled
 Bridge Config-
 Digest-Snooping     : Disabled
 TC or TCN received  : 10
 Time since last TC  : 0 days 0h:0m:43s

----[Port54(FortyGigE1/0/53)][DOWN]----
 Port protocol       : Enabled
 Port role           : Disabled Port
 Port ID             : 128.54
 Port cost(Legacy)   : Config=auto, Active=200000
 Desg.bridge/port    : 32768.6c39-795e-0300, 128.54
 Port edged          : Config=disabled, Active=disabled
 Point-to-Point      : Config=auto, Active=false
 Transmit limit      : 10 packets/hello-time
 TC-Restriction      : Disabled
 Role-Restriction    : Disabled
<H3C>display stp brief                                              查看端口状态
 MST ID Port Role STP State Protection
 0 GigabitEthernet1/0/1 ROOT FORWARDING NONE                        root跟端口,forwarding处于转发状态
 0 GigabitEthernet1/0/4 ALTE DISCARDING NONE                        alte备份状态,discarding处于丢弃状
 0 GigabitEthernet1/0/3 DESI FORWARDING NONE                        desi指定端口,forwarding处于转发状态

   4、交换机每隔两秒发送BPDU报文来交换优先级、mac等地址

  

  5、BPDU封装的信息

  

   6、端口的各个状态

  

   7、端口状态的迁移

  

   8、stp生成树的不足

  

二、RSTP快速生成树

  1、RSTP介绍

  

   2、RSTP的改进

  

  3、RSTP基本命令

[H3C]stp mode rstp                                                       开启rstp生成树
[H3C]display stp                                                         查看stp生成树
-------[CIST Global Info][Mode RSTP]-------                              mode类型为RSTP
Bridge ID : 32768.6c39-74d6-0200
Bridge times : Hello 2s MaxAge 20s FwdDelay 15s MaxHops 20
Root ID/ERPC : 32768.6c39-700e-0100, 20
RegRoot ID/IRPC : 32768.6c39-74d6-0200, 0
RootPort ID : 128.2
BPDU-Protection : Disabled
Bridge Config-
Digest-Snooping : Disabled
TC or TCN received : 2
Time since last TC : 0 days 0h:0m:32s

----[Port54(FortyGigE1/0/53)][DOWN]----
Port protocol : Enabled
Port role : Disabled Port
Port ID : 128.54
Port cost(Legacy) : Config=auto, Active=200000
Desg.bridge/port : 32768.6c39-74d6-0200, 128.54
Port edged : Config=disabled, Active=disabled
Point-to-Point : Config=auto, Active=false
Transmit limit : 10 packets/hello-time
TC-Restriction : Disabled
Role-Restriction : Disabled
Protection type : Config=none, Active=none
MST BPDU format : Config=auto, Active=802.1s

[H3C]display stp brief
MST ID Port Role STP State Protection
0 GigabitEthernet1/0/1 ROOT FORWARDING NONE
0 GigabitEthernet1/0/4 DESI FORWARDING NONE

三、MSTP多生成树

  1、介绍

  

   2、传统生成树的问题

  

   3、三种生成树协议的比较

  

   4、实例配置

  

      1)每个交换机上创建vlan 10 、vlan20

[H3C]vlan 10
[H3C]vlan 20
[sw3]interface GigabitEthernet 1/0/2                                
[sw3-GigabitEthernet1/0/2]port link-type trunk                                 所有接口设置为trunk模式
[sw3-GigabitEthernet1/0/2] port trunk permit vlan all 允许所有vlan通过

    2)设置区域,给区域命名

[H3C]stp region-configuration          
[H3C-mst-region]region-name h3c                           给区域取个名字
[H3C-mst-region]instance 1 vlan 10                        将vlan10划到组1
[H3C-mst-region]instance 2 vlan 20                        将vlan20划到组2
[H3C-mst-region]active region-configuration 激活以上配置

    3)查看以上配置

[H3C-mst-region]display this
#
stp region-configuration
 region-name h3c
 instance 1 vlan 10
 instance 2 vlan 20
 active region-configuration
#
return

    4)调整实例根桥

[sw1]stp instance 1 root primary                          sw1设置为组1的根桥
[sw1]stp instance 2 root secondary sw1设置组2为备份根桥(可以敲,也可以省略) [sw2]stp instance
2 root primary sw2设置为组2的根桥

     5)查看sw1验证结果

[sw1]display stp brief
 MST ID   Port                                Role  STP State   Protection
 0        GigabitEthernet1/0/1                DESI  FORWARDING  NONE
 0        GigabitEthernet1/0/2                DESI  FORWARDING  NONE
 1        GigabitEthernet1/0/1                DESI  FORWARDING  NONE                           对于实例1,sw1的两个接口都为指定接口
 1        GigabitEthernet1/0/2                DESI  FORWARDING  NONE                           指定接口
 2        GigabitEthernet1/0/1                DESI  FORWARDING  NONE                           
 2        GigabitEthernet1/0/2                ROOT  FORWARDING  NONE

[sw2]display stp brief
 MST ID   Port                                Role  STP State   Protection
 0        GigabitEthernet1/0/1                ROOT  FORWARDING  NONE
 0        GigabitEthernet1/0/2                DESI  FORWARDING  NONE
 1        GigabitEthernet1/0/1                ROOT  FORWARDING  NONE
 1        GigabitEthernet1/0/2                DESI  FORWARDING  NONE
 2        GigabitEthernet1/0/1                DESI  FORWARDING  NONE                           对于实例2,sw2的两个接口都为指定接口
 2        GigabitEthernet1/0/2                DESI  FORWARDING  NONE                           指定接口

  注意1:默认交换机运行的就是MSTP,所有的vlan都在实例0里面

  注意2:默认MSTP里面每个实例单独运行的RSTP

 

posted @ 2020-10-16 09:33  人走茶良  阅读(2440)  评论(0编辑  收藏  举报
推荐:华为云