2010年3月21日 星期日

How to Control STP Block Port

SwA(config)# spanning-tree vlan 1 root primary
SwB(config)# spanning-tree vlan 1 root secondary
如果依照 圖上的 root priority 設定的話,預設block port 是在下方線路的其中一個port


這時,需在控制線路頻寬,已達到圖上所要的block port。
需設定 C ---> B ---> A 路徑成本 大於  C ---> D ---> A的成本。
此時走 c - b -a 的成本過高所以  C-B 線路會被block掉,那B的 priority 又高於 C
所以,Block port 就會被控制在如圖上所示的地方。


此分為兩種設定方式: 


1.如果 SwB -> SwC 的 Interface 是 L3 則設定 bandwidth 即可.

SwB(config)# int fa 0/1 
SwB(config-if)# bandwidth  xxxx


2.如果 SwB -> SwC 的 Interface 是 L2 則需調整 spanning 的 cost

SwB(config)# int fa 0/1 
SwB(config-if)# spanning vlan 1 cost  XXX(Range is 1-200000000)   (default  是該線路的速度 )
cost 越高, 表示越優先..

註: L2還有另一個指令 panning vlan 1 port-priority xxxx  (Rnage 0-240 , 以16為倍數 ex :0,16,32.....)
可以調整 同一switch上 不同Interface的優先權. (需兩個介面外在優先權相同的條件下.才成立,否則需要更改Cost)


沒有留言:

張貼留言