華為 配置STP預防環路

2021-08-20 20:06:06 字數 2905 閱讀 5540

1、在乙個複雜的網路中,網路規劃者由於冗餘備份的需要,一般都傾向於在裝置之間部署多條物理鏈路,其中一條作主用鏈路,其他鏈路作備份。這樣就難免會形成環形網路,若網路中存在環路,可能會引起廣播風暴和mac表項被破壞。

網路規劃者規劃好網路後,可以在網路中部署stp協議預防環路。當網路中存在環路,stp通過阻塞某個埠以達到破除環路的目的。如圖所示,當前網路中存在環路,switcha、switchb、switchc和switchd都執行stp,通過彼此互動資訊發現網路中的環路,並有選擇的對某個埠進行阻塞,最終將環形網路結構修剪成無環路的樹形網路結構,從而防止報文在環形網路中不斷迴圈,避免裝置由於重複接收相同的報文造成處理能力下降。

2、網路拓撲

3、配置思路

在處於環形網路中的交換裝置上配置stp基本功能,包括:

配置環網中的裝置生成樹協議工作在stp模式。

配置根橋和備份根橋裝置。

配置埠的路徑開銷值,實現將該埠阻塞。

使能stp,實現破除環路。

1、配置交換機stp的工作模式

system-view

[huawei]sysname switcha

[switcha]stp mode stp

system-view

[huawei]sysname switchb

[switchb]stp mode stp

system-view

[huawei]sysname switchc

[switchc]stp mode stp

system-view

[huawei]sysname switchd

[switchd]stp mode stp

2、配置switcha為根橋,switchd為備份根橋

[switcha]stp root primary

[switchd]stp root secondary

3、加大switchc的g0/0/1埠開銷

[switchc]inte***ce gigabitethernet 0/0/1	

[switchc-gigabitethernet0/0/1]stp cost 20000

[switchc-gigabitethernet0/0/1]q

4、裝置全域性使能stp

[switcha]stp enable

[switchb]stp enable

[switchc]stp enable

[switchd]stp enable

5、與pc相連的埠可以去除使能stp

[switchb]inte***ce  gigabitethernet  0/0/2

[switchb-gigabitethernet0/0/2]stp disable

[switchb-gigabitethernet0/0/2]quit

[switchc]inte***ce gigabitethernet 0/0/2

[switchc-gigabitethernet0/0/2]stp disable

[switchc-gigabitethernet0/0/2]quit

6、檢視結果

[switcha]display  stp brief 

mstid port role stp state protection

0 gigabitethernet0/0/1 desi forwarding none

0 gigabitethernet0/0/2 desi forwarding none

0 gigabitethernet0/0/3 desi forwarding none

將switcha配置為根橋後,與switchb、switchd相連的埠gigabitethernet0/0/2和gigabitethernet0/0/1在生成樹計算中被選舉為指定埠。

[switchb]display stp brief 

mstid port role stp state protection

0 gigabitethernet0/0/1 desi forwarding none

0 gigabitethernet0/0/3 root forwarding none

埠gigabitethernet0/0/1在生成樹選舉中成為指定埠,處於forwarding狀態。

[switchc]display  stp  brief 

mstid port role stp state protection

0 gigabitethernet0/0/1 root forwarding none

0 gigabitethernet0/0/3 alte discarding none

埠gigabitethernet0/0/3在生成樹選舉中成為根埠,處於forwarding狀態。

埠gigabitethernet0/0/1在生成樹選舉中成為alternate埠,處於discarding阻塞狀態

華為STP相關功能配置

1.配置工作模式 2.配置橋優先順序 3.配置是否成為根橋 如果是primary,優先順序為0 secondary,優先順序為4096 4.配置根路徑開銷計算法,同一網路中應該保持一致 可以使用undo命令,恢復到預設的計算方式 5.設定具體的cost值 6.配置埠優先順序 範圍為0 240 7.配...

環路問題以及STP生成樹

ip 節點 區域性有效性 mac 可控的環路 stp生成樹 如何實現 bpdu 橋協議資料單元 根橋id rootid 根路徑開銷 rootpathcost 最短路徑 指定橋id designatedbridgeid 指定埠id designatedportid 工作原理 選根計算開銷cost值 非...

華為STP實驗帶詳解

1.l1必須是stp的根橋 2.再看各個埠的角色和狀態找到哪個埠是ap 3.把l3上的e0 0 3口 設定為預備狀態 ap 4.再檢視各個埠的狀態和角色 l1 l1 stp mode stpl2 l2 stp mode stpl3 l3 stp mode stp可以看到l1上都是指定埠dp,而且都是...