配置MST實現負載均衡
三臺交換機SW1、SW2、SW3,共有四個VLAN,此處的鏈路均爲100M鏈路,現在使用MST 技術,實現SW1 成爲VLAN 1、VLAN 2 的根網橋,SW2 成爲VLAN 3、VLAN 4 的根網橋,數據包從SW3 流出時要分成兩個方向,VLAN 1-2 的數據包轉發到SW1 方向,而VLAN 3-4 的數據包轉發到SW2方向。並且儘量產生較少的生成樹實例,一方面減少CPU 及內存的負擔。一方面要實現VLAN 的負載均衡。
【實驗步驟】
第一部分:配置Ether-Channel
SW1<config>#interface port-channel 1
//創建以太網通道
SW1<config>#interface f0/1
SW1<config-if>#channel-group 1 mode on
SW1<config>#interface f0/2
SW1<config-if>#channel-group 1 mode on
//將物理接口制定到已創建的通道中
SW1<config>#int port-channel 1
SW1<config-if>#switchport mode trunk
SW1<config-if>#speed 100
SW1<config-if>#duplex full
//配置通道中的物理接口的速率及雙工等屬性
SW2<config>#interface port-channel 1
//創建以太網通道
SW2<config>#interface f0/1
SW2<config-if>#channel-group 1 mode on
SW2<config>#interface f0/2
SW2<config-f>#channel-group 1 mode on
//將物理接口制定到已創建的通道中
SW2<config-if>#switchportmode tunk
SW2<config-if>#speed100
SW2<config-if>#duplexfull
//配置通道中的物理接口的速率及雙工等屬性[李鵬1]
S1<config>#port-channel load-balance dst-mac
S2<config>#port-channel load-balance dst-mac
//以上是配置EtherChannel的負載平衡
//可以看到EtherChannel協商成功
第二部分:配置VLAN
首先在三個交換機上配置相應的VLAN。
端口加入VLAN
第三部分:配置MST
1、首先在交換機SW1上啓用MST
SW1<config>spanning-tree mode mst
進入MST 配置模式
SW1<config>spanning-tree mst config
配置MST域名
SW1<config-mst>namebenet
配置修訂號
SW1<config-mst>revision10
將VLAN映射到MST實例
SW1<config-mst>instance1 vlan 1-2
SW1<config-mst>instance2 vlan 3-4
設置MST實例的優先級
SW1<config>spanning-treemst 1 priority 4096
SW1<config>spanning-treemst 2 priority 8192
下面是SW2上的配置,除了MST 實例優先級配置的不同之外其它配置都是一樣的
SW2<config>spanning-tree mode mst
SW2<config>spanning-tree mst config
SW2<config-mst>name benet
SW2<config-mst>revision 10
SW2<config-mst>instance 1 vlan 1-2
SW2<config-mst>instance2 vlan 3-4
SW2<config>spanning-treemst 2 priority 4096
SW2<config>spanning-treemst 1 priority 8192
8、SW3上的配置(區域名、修訂號和上面配置的保持一致)
SW3<config>spanning-treemode mst
SW3<config>spanning-tree mst config
SW3<config-mst>name benet
SW3<config-mst>revision10
SW3<config-mst>instance1 vlan 1-2
SW3<config-mst>instance2 vlan 3-4
[李鵬1]可以不配置