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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM