Huawei-R&S-網絡工程師實驗筆記20190607-STP生成樹協議(基本配置、橋優先級、根橋選舉、根端口、路徑開銷、邊緣端口)


》Huawei-R&S-網絡工程師實驗筆記20190607-STP生成樹協議(基本配置、橋優先級、根橋選舉、根端口、路徑開銷、邊緣端口)

》》實驗開始,先上拓撲圖參考:

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWA
[SWA]stp ?         //查詢STP協議下配置命令
  bpdu-filter           STP BPDU filter
  bpdu-protection       Specify BPDU protection function
  bridge-diameter       Specify bridge diameter
  converge              Specify STP converge mode
  disable               Disable Spanning Tree Protocol (STP)   //禁用STP
  edged-port            Specify edge port
  enable                Enable Spanning Tree Protocol (STP) //啟用STP
  instance              Spanning tree instance
  max-hops              Specify max hops
  mcheck                Specify mcheck
  mode                  Specify state machine mode
  pathcost-standard     Specify STP port path cost standard
  priority              Specify bridge priority      //指定橋優先級
  process               The MSTP process
  region-configuration  Enter MSTP region view
  root                  Specify root switch
  snooping              STP snooping
  tc-protection         Enable the TC-BPDU Protection function
  timer                 Specify timer configuration
  timer-factor          Specify aged out time factor

[SWA]stp disable          //關閉STP
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA]
Jun  7 2019 22:47:46-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.

[SWA]display stp         //查看STP協議狀態
 Protocol Status       :Disabled    //STP協議已經被關閉       
 Protocol Standard     :IEEE 802.1s             
 Version               :3             
 CIST Bridge Priority  :32768    //橋ID的默認優先級為32768             
 MAC address           :4c1f-cca8-6f8e             
 Max age(s)            :20     //最大老化時長為20秒             
 Forward delay(s)      :15     //轉發延時為15秒         
 Hello time(s)         :2    //問候時長為2秒        
 Max hops              :20 
[SWA]
[SWA]stp enable          //開啟STP
Warning: The global STP state will be changed. Continue? [Y/N]y
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA]
Jun  7 2019 22:49:06-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[SWA]
[SWA]display stp         //查看STP協議狀態
-------[CIST Global Info][Mode MSTP]-------     //默認配置是MSTP
CIST Bridge         :32768.4c1f-cca8-6f8e
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-cc27-5e6e / 20000
CIST RegRoot/IRPC   :32768.4c1f-cca8-6f8e / 0
CIST RootPortId     :128.25
BPDU-Protection     :Disabled
TC or TCN received  :10
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:24m:6s
Number of TC        :2
Last TC occurred    :GigabitEthernet0/0/3
----   -- more --    ----
[SWA]
[SWA]stp mode ?         //查詢修改生成樹模式的配置命令
  mstp  Multiple Spanning Tree Protocol (MSTP) mode
  rstp  Rapid Spanning Tree Protocol (RSTP) mode
  stp   Spanning Tree Protocol (STP) mode

[SWA]stp mode stp        //修改生成樹模式為STP
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA]
Jun  7 2019 23:19:36-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[SWA]dis stp         //查看STP協議狀態
-------[CIST Global Info][Mode STP]-------     //默認配置已改為STP(SWB如法炮制,也改為STP)
CIST Bridge         :32768.4c1f-cca8-6f8e
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-cc27-5e6e / 20000
CIST RegRoot/IRPC   :32768.4c1f-cca8-6f8e / 0
CIST RootPortId     :128.25
BPDU-Protection     :Disabled
TC or TCN received  :26
TC count per hello  :2
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:30m:21s
Number of TC        :2
Last TC occurred    :GigabitEthernet0/0/3
----   -- more --    ----
[SWA]
[SWA]stp priority ?    //修改橋優先級
  INTEGER<0-61440>  Bridge priority, in steps of 4096    //輸入的橋優先級必須是4096的倍數

[SWA]stp priority 0    //修改SWA的橋優先級為0(SWA配置為根橋,因為SWB的橋優先級還是32678)
[SWA]
Jun  7 2019 23:39:36-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[SWA]dis stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :0    .4c1f-cca8-6f8e
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :0    .4c1f-cca8-6f8e / 0
CIST RegRoot/IRPC   :0    .4c1f-cca8-6f8e / 0
CIST RootPortId     :0.0
BPDU-Protection     :Disabled
TC or TCN received  :81
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:12m:59s
Number of TC        :6
Last TC occurred    :GigabitEthernet0/0/1
  ---- More ----
[SWB]dis stp bri     //查看配置(STP協議收斂后,SWB的G0/0/1端口成為了根端口)
 MSTID  Port                        Role  STP State     Protection
   0    GigabitEthernet0/0/1        ROOT  DISCARDING      NONE
   0    GigabitEthernet0/0/2        ALTE  DISCARDING      NONE
   0    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
====================================
[SWA]int g0/0/1       //進入SWA的G0/0/1端口配置
[SWA-GigabitEthernet0/0/1]stp port priority ?         //查詢修改端口優先級的命令
  INTEGER<0-240>  Port priority, in steps of 16        //優先級按16的倍數調整(默認為128)

[SWA-GigabitEthernet0/0/1]stp port priority 240        //將SWA的G0/0/1端口優先級調整為240(大於128)
[SWA-GigabitEthernet0/0/1]
Jun  7 2019 23:51:47-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[SWA-GigabitEthernet0/0/1]q
[SWA]     //(或者配置SWA的G0/0/2端口,修改優先級為16,小於128。這樣也可以實現實驗效果)
====================================
[SWB]dis stp bri     //查看配置(修改SWA的G0/0/1端口優先級后,SWB的G0/0/2端口成為了根端口)
 MSTID  Port                        Role  STP State     Protection
   0    GigabitEthernet0/0/1        ALTE  DISCARDING      NONE
   0    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE      //SWB的G0/0/2端口被選舉為根端口
   0    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
[SWB]dis stp int g0/0/1       //查看G0/0/1端口下STP協議狀態(關於配置根端口,還可以通過修改端口開銷PC使G0/0/2成為根端口)
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :32768.4c1f-cc27-5e6e
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :0    .4c1f-cca8-6f8e / 20000       //根路徑開銷RPC為20000
CIST RegRoot/IRPC   :32768.4c1f-cc27-5e6e / 0
CIST RootPortId     :128.1
BPDU-Protection     :Disabled
TC or TCN received  :114
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:25m:13s
Number of TC        :18
Last TC occurred    :GigabitEthernet0/0/1
----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
 Port Protocol       :Enabled
 Port Role           :Root Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000       //G0/0/1端口開銷PC為20000
 Designated Bridge/Port   :0.4c1f-cca8-6f8e / 128.25
 Port Edged          :Config=default / Active=disabled
 Point-to-point      :Config=auto / Active=true
 Transit Limit       :147 packets/hello-time
 Protection Type     :None
 Port STP Mode       :STP 
 Port Protocol Type  :Config=auto / Active=dot1s
 BPDU Encapsulation  :Config=stp / Active=stp
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0
 TC or TCN send      :18
 TC or TCN received  :53
 BPDU Sent           :367             
          TCN: 1, Config: 366, RST: 0, MST: 0
 BPDU Received       :1128             
          TCN: 0, Config: 1128, RST: 0, MST: 0
----[Port2(GigabitEthernet0/0/2)][DISCARDING]----
 Port Protocol       :Enabled
 Port Role           :Alternate Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000       //G0/0/2端口開銷PC也是20000
 Designated Bridge/Port   :0.4c1f-cca8-6f8e / 128.26
 Port Edged          :Config=default / Active=disabled
 Point-to-point      :Config=auto / Active=true
 Transit Limit       :147 packets/hello-time
 Protection Type     :None
 Port STP Mode       :STP 
 Port Protocol Type  :Config=auto / Active=dot1s
 BPDU Encapsulation  :Config=stp / Active=stp
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0
 TC or TCN send      :19
 TC or TCN received  :53
 BPDU Sent           :369             
          TCN: 2, Config: 367, RST: 0, MST: 0
 BPDU Received       :1402             
          TCN: 0, Config: 1402, RST: 0, MST: 0
  ---- More ----

[SWB]int g0/0/1
[SWB-GigabitEthernet0/0/1]stp cost ?      //查詢修改端口(路徑)開銷的命令
  INTEGER<1-200000000>  Port path cost

[SWB-GigabitEthernet0/0/1]stp cost 30000    //修改G0/0/1的端口開銷為30000(大於G0/0/2的端口開銷20000)
[SWB-GigabitEthernet0/0/1]
Jun  8 2019 00:34:18-08:00 SWB DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[SWB-GigabitEthernet0/0/1]q
                  //(或者將G0/0/2的端口開銷調小為1999,小於20000。這樣也可以實現實驗效果)
[SWB]dis stp bri
 MSTID  Port                        Role  STP State     Protection
   0    GigabitEthernet0/0/1        ALTE  DISCARDING      NONE
   0    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE     //端口G0/0/2被選舉為根端口
   0    GigabitEthernet0/0/3        DESI  FORWARDING      NONE
[SWB]      
[SWB]int g0/0/3
[SWB-GigabitEthernet0/0/3]stp edged-port ?         //查詢邊緣端口配置命令
  disable  Disable edge port
  enable   Enable edge port

[SWB-GigabitEthernet0/0/3]stp edged-port enable        //配置G0/0/3端口為邊緣端口
[SWB-GigabitEthernet0/0/3]
Jun  8 2019 00:48:48-08:00 SWB DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.

[SWB-GigabitEthernet0/0/3]dis stp int g0/0/3
-------[CIST Global Info][Mode STP]-------
CIST Bridge         :32768.4c1f-cc27-5e6e
Config Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times        :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC      :0    .4c1f-cca8-6f8e / 20000
CIST RegRoot/IRPC   :32768.4c1f-cc27-5e6e / 0
CIST RootPortId     :128.2
BPDU-Protection     :Disabled
TC or TCN received  :185
TC count per hello  :0
STP Converge Mode   :Normal 
Time since last TC  :0 days 0h:14m:58s
Number of TC        :21
Last TC occurred    :GigabitEthernet0/0/2
----[Port3(GigabitEthernet0/0/3)][FORWARDING]----
 Port Protocol       :Enabled
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=20000
 Designated Bridge/Port   :32768.4c1f-cc27-5e6e / 128.3
 Port Edged          :Config=enabled / Active=enabled     //端口G0/0/3已配置為邊緣端口,且為活動狀態
 Point-to-point      :Config=auto / Active=true
 Transit Limit       :147 packets/hello-time
 Protection Type     :None
 Port STP Mode       :STP 
 Port Protocol Type  :Config=auto / Active=dot1s
 BPDU Encapsulation  :Config=stp / Active=stp
 PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20
 TC or TCN send      :136
 TC or TCN received  :0
 BPDU Sent           :2309             
          TCN: 0, Config: 2309, RST: 0, MST: 0
 BPDU Received       :0             
          TCN: 0, Config: 0, RST: 0, MST: 0
[SWB-GigabitEthernet0/0/3] 

 


免責聲明!

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



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