目錄
- 一、MSTP介紹
- 二、MSTP基本原理
- 三、MSTP保護功能
- 四、MSTP相關配置
一、MSTP介紹
傳統的生成樹只運行一個實例且收斂速度慢,RSTP在傳統的STP基礎上通過和改進,達到了加速網絡收斂的目的,但是仍有有缺陷。由於STP和RSTP在整個局域網中,所有的VLAN共享一個生成樹實例,因此無法實現基於VLAN的負載均衡,網絡環境穩定狀態下備份鏈路始終不能轉發數據流量,造成帶寬的浪費。隨後RVST和MSTP發展起來。
PVST是思科私有的,它能讓多實例,多VLAN可以進行負載均衡,但它也有缺陷。一個實例只能跑一個VLAN,意味着100個VLAN要開100個實例,是很吃資源的,這是它的弊端。
MSTP,多生成樹協議,一個實例當中包含多個VLAN,它這個性能要比PVST性能好得多,現在運用最廣。
簡單説來,STP/RSTP是基於端口的,PVST是基於VLAN的,而MSTP是基於實例的。
二、MSTP基本原理
通過MSTP把一個交換網絡劃分成多個域,每個域內形成多棵生成樹,生成樹之間彼此獨立。每棵生成樹叫做一個多生成樹實例MSTI(Multiple Spanning Tree Instance),每個域叫做一個MST域(MST Region:Multiple Spanning Tree Region)。實現MST就要表示實例並加入優先級。
三、MSTP保護功能
1.BPDU保護
stp bpdu-protection
2.根保護
int e0/0/1
stp root-protection
3.環路保護
int e0/0/1
stp loop-protection
4.TC保護
stp tc-protection threshold 3
四、MSTP相關配置
S1的MSTP配置:
[sw1]stp mode mstp————設為多生成樹
[sw1]stp region-configuration————生成MST域
[SW1-mst-region]region-name huawei————域名叫huawei
[sw1-mst-region]revision-level 1————等級默認 1
[sw1-mst-region]instance 1 vlan 10————線路歸屬
[sw1-mst-region]instance 2 vlan 20
[sw1-mst-region]active region-configuration ————激活
[sw1-mst-region]quit
[sw1]stp instance 1 root primary ————主要線路
[sw1]stp instance 2 root secondary ————次要線路,主線路出現問題備用
S2的MSTP配置:
同理,前面一樣,只要把優先級更換一下就行了
[sw2]stp mode mstp————設為多生成樹
[sw2]stp region-configuration————生成MST域
[SW2-mst-region]region-name huawei————域名叫huawei
[sw2-mst-region]revision-level 1————等級默認 1
[sw2-mst-region]instance 1 vlan 10————線路歸屬
[sw2-mst-region]instance 2 vlan 20
[sw2-mst-region]active region-configuration ————激活
[sw2-mst-region]quit
[sw2]stp instance 1 root secondary————備
[sw2]stp instance 2 root primary————主
S3的MSTP配置:
S3沒有優先級線路之分,只需配域、實例和等級就行了
[sw3]stp mode mstp————設為多生成樹
[sw3]stp region-configuration————生成MST域
[sw3-mst-region]region-name huawei————域名叫huawei
[sw3-mst-region]revision-level 1————等級默認 1
[sw3-mst-region]instance 1 vlan 10————線路歸屬
[sw3-mst-region]instance 2 vlan 20
[sw3-mst-region]active region-configuration ————激活
[sw3-mst-region]quit