現在位置: ホーム / みらくるブログ / GNS3 活用 - Cisco スイッチ STP 編 その11 (MSTで効率的なVLANの管理および負荷分散を)

GNS3 活用 - Cisco スイッチ STP 編 その11 (MSTで効率的なVLANの管理および負荷分散を)

spanning-tree の機能である MST を使ってみます。これでいくつVLANが増えても安心ですね。

お疲れさまです。ニックネーム たいちょう です。

今回は、MST をやってみます。前回(GNS3 活用 - Cisco スイッチ STP 編 その10 (rapid spanning-tree 、rapid-pvst で素早いコンバージェンス) )の続きです。

spanninng-tree の観点で、VLAN をいくつも作成して経路分散をした時にかかる管理の手間をVLANをグルーピングすることにより効率的な管理を目指します。

タスク:

  • 以下の VLAN を作成する。
    VLAN 101,102,103,104,105
    VLAN 201,202,203,204,205

  • VLAN101-105を左回りに、VLAN101-105を右回りに設定する。
  • 設定後、MSTを有効にする。
  • できたかどうかを確認して、図にする。
  • トポロジは、以下のものを使用する。

作業記録です。

一例として、Sw1 での作業です。
Sw1-Sw4 全てで設定しました。


Sw1#conf t
Sw1(config)#vlan 101-105
Sw1(config)#vlan 201-205
Sw1#sho vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/2, Et0/3, Et1/0, Et1/1
                                                Et1/2, Et1/3, Et2/0, Et2/1
                                                Et2/2, Et2/3, Et3/0, Et3/1
                                                Et3/2, Et3/3
101  VLAN0101                         active    
102  VLAN0102                         active    
103  VLAN0103                         active    
104  VLAN0104                         active    
105  VLAN0105                         active    
201  VLAN0201                         active    
202  VLAN0202                         active    
203  VLAN0203                         active    
204  VLAN0204                         active    
205  VLAN0205                         active    
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0   
101  enet  100101     1500  -      -      -        -    -        0      0   
102  enet  100102     1500  -      -      -        -    -        0      0   
103  enet  100103     1500  -      -      -        -    -        0      0   

Sw1#sho spanning-tree bri

                                                   Hello  Max  Fwd
Vlan                         Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
VLAN0001         32769 (32768,   1) aabb.cc00.0400    2    20   15  ieee        
VLAN0101         32869 (32768, 101) aabb.cc00.0400    2    20   15  ieee        
VLAN0102         32870 (32768, 102) aabb.cc00.0400    2    20   15  ieee        
VLAN0103         32871 (32768, 103) aabb.cc00.0400    2    20   15  ieee        
VLAN0104         32872 (32768, 104) aabb.cc00.0400    2    20   15  ieee        
VLAN0105         32873 (32768, 105) aabb.cc00.0400    2    20   15  ieee        
VLAN0201         32969 (32768, 201) aabb.cc00.0400    2    20   15  ieee        
VLAN0202         32970 (32768, 202) aabb.cc00.0400    2    20   15  ieee        
VLAN0203         32971 (32768, 203) aabb.cc00.0400    2    20   15  ieee        
VLAN0204         32972 (32768, 204) aabb.cc00.0400    2    20   15  ieee        
VLAN0205         32973 (32768, 205) aabb.cc00.0400    2    20   15  ieee        

Sw1#wri
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration...
Compressed configuration from 1533 bytes to 878 bytes[OK]

(上記は、Sw2-Sw4 でも同様に設定)

point-to-point の設定をします。

Sw1(config)#int range e0/0 - 1
Sw1(config-if-range)#spanning-tree link-type point-to-point 

(上記は、Sw2-Sw4 でも同様に設定します。)

trunk の設定をします。


Sw1(config)#int range e0/0 - 1
Sw1(config-if-range)#switchport trunk enc dot
Sw1(config-if-range)#switchport mode trunk
Sw1(config-if-range)#switchport trunk allowed vlan 101-105,201-205
Sw1(config-if-range)#end
Sw1#sho int trunk

Port        Mode             Encapsulation  Status        Native vlan
Et0/0       on               802.1q         trunking      1
Et0/1       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Et0/0       101-105,201-205
Et0/1       101-105,201-205

Port        Vlans allowed and active in management domain
Et0/0       101-105,201-205
Et0/1       101-105,201-205

Port        Vlans in spanning tree forwarding state and not pruned
Et0/0       101-105,201-205
Et0/1       101-105,201-205

Sw1#wri
Building configuration...
Compressed configuration from 1941 bytes to 1113 bytes[OK]

(上記は、Sw2-Sw4 でも同様に設定します。)

それでは、MSTを設定していきます。

Sw1(config)#spanning-tree mst configuration
Sw1(config-mst)#name region1
Sw1(config-mst)#revision 1
Sw1(config-mst)#instance 1 vlan 101-105
Sw1(config-mst)#instance 2 vlan 201-205
Sw1(config-mst)#sho pending
Pending MST configuration
Name      [region1]
Revision  1     Instances configured 3

Instance  Vlans mapped
--------  ---------------------------------------------------------------------
0         1-100,106-200,206-4094
1         101-105
2         201-205
-------------------------------------------------------------------------------
(上記は、Sw2-Sw4 でも同様に設定します。)

まだMSTは有効にしていません。
MST の設定自体は終わったので、ここでMSTを有効にします。

Sw1(config)#spanning-tree mode mst
Sw1(config)#end
Sw1#sho spanning-tree

MST0
  Spanning tree enabled protocol mstp
  Root ID    Priority    32768
             Address     aabb.cc00.0400
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768  (priority 32768 sys-id-ext 0)
             Address     aabb.cc00.0400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg BLK 2000000   128.1    P2p Bound(PVST)
Et0/1               Desg BLK 2000000   128.2    P2p Bound(PVST)
Et0/2               Desg BLK 2000000   128.3    Shr
Et0/3               Desg BLK 2000000   128.4    Shr
Et1/0               Desg BLK 2000000   128.5    Shr
Et1/1               Desg BLK 2000000   128.6    Shr
Et1/2               Desg BLK 2000000   128.7    Shr
Et1/3               Desg BLK 2000000   128.8    Shr
Et2/0               Desg BLK 2000000   128.9    Shr
Et2/1               Desg BLK 2000000   128.10   Shr
Et2/2               Desg LRN 2000000   128.11   Shr
Et2/3               Desg LRN 2000000   128.12   Shr
Et3/0               Desg LRN 2000000   128.13   Shr
Et3/1               Desg FWD 2000000   128.14   Shr
Et3/2               Desg FWD 2000000   128.15   Shr
Et3/3               Desg FWD 2000000   128.16   Shr
          
          
          
MST1      
  Spanning tree enabled protocol mstp
  Root ID    Priority    32769
             Address     aabb.cc00.0400
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
          
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     aabb.cc00.0400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
          
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 2000000   128.1    P2p Bound(PVST)
Et0/1               Desg FWD 2000000   128.2    P2p Bound(PVST)
          
          
          
MST2      
  Spanning tree enabled protocol mstp
  Root ID    Priority    32770
             Address     aabb.cc00.0400
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
          
  Bridge ID  Priority    32770  (priority 32768 sys-id-ext 2)
             Address     aabb.cc00.0400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
          
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 2000000   128.1    P2p Bound(PVST)
Et0/1               Desg FWD 2000000   128.2    P2p Bound(PVST)

Sw1#wri
(上記は、Sw2-Sw4 でも同様に設定します。)
このコマンドでも確認します。
全てのスイッチでの結果を表示します。

Sw1#sho spanning-tree mst 1,2

##### MST1    vlans mapped:   101-105
Bridge        address aabb.cc00.0400  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0100  priority      32769 (32768 sysid 1)
              port    Et0/1           cost          2000000   rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/0            Desg FWD 2000000   128.1    P2p
Et0/1            Root FWD 2000000   128.2    P2p

##### MST2    vlans mapped:   201-205
Bridge        address aabb.cc00.0400  priority      32770 (32768 sysid 2)
Root          address aabb.cc00.0100  priority      32770 (32768 sysid 2)
              port    Et0/1           cost          2000000   rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/0            Desg FWD 2000000   128.1    P2p
Et0/1            Root FWD 2000000   128.2    P2p

Sw2#sho spanning-tree mst 1,2

##### MST1    vlans mapped:   101-105
Bridge        address aabb.cc00.0100  priority      32769 (32768 sysid 1)
Root          this switch for MST1

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/1            Desg FWD 2000000   128.2    P2p
Et0/2            Desg FWD 2000000   128.3    P2p

##### MST2    vlans mapped:   201-205
Bridge        address aabb.cc00.0100  priority      32770 (32768 sysid 2)
Root          this switch for MST2

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/1            Desg FWD 2000000   128.2    P2p
Et0/2            Desg FWD 2000000   128.3    P2p

Sw3#sho spanning-tree mst 1,2

##### MST1    vlans mapped:   101-105
Bridge        address aabb.cc00.0500  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0100  priority      32769 (32768 sysid 1)
              port    Et0/3           cost          4000000   rem hops 18

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/0            Altn BLK 2000000   128.1    P2p
Et0/3            Root FWD 2000000   128.4    P2p

##### MST2    vlans mapped:   201-205
Bridge        address aabb.cc00.0500  priority      32770 (32768 sysid 2)
Root          address aabb.cc00.0100  priority      32770 (32768 sysid 2)
              port    Et0/3           cost          4000000   rem hops 18

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/0            Altn BLK 2000000   128.1    P2p
Et0/3            Root FWD 2000000   128.4    P2p

Sw4#sho spanning-tree mst 1,2

##### MST1    vlans mapped:   101-105
Bridge        address aabb.cc00.0300  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0100  priority      32769 (32768 sysid 1)
              port    Et0/2           cost          2000000   rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/2            Root FWD 2000000   128.3    P2p
Et0/3            Desg FWD 2000000   128.4    P2p

##### MST2    vlans mapped:   201-205
Bridge        address aabb.cc00.0300  priority      32770 (32768 sysid 2)
Root          address aabb.cc00.0100  priority      32770 (32768 sysid 2)
              port    Et0/2           cost          2000000   rem hops 19

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/2            Root FWD 2000000   128.3    P2p
Et0/3            Desg FWD 2000000   128.4    P2p

ここで、タスクを再確認します。VLAN 101-105 を左回りに、VLAN 201-205 を右回りにする、でした。
それぞれの VLANグループは、インスタンス 1、インスタンス 2 にグルーピングしました。

そこで、インスタンス1を左回り、インスタンス2を右回りにすれば良さそうです。

一番確実なのは、ブリッジプライオリティを変更する方法です。インスタンス1、インスタンス2 両者で Sw1 を root primary に、Sw3 でインスタンス1、Sw2 でインスタンス2 を root secondary にすればよさそうです。
では、やってみます。
 
まず、現在のspanning-tree の状態を確認します。表示で、MST が有効になっていますので、変化があるのが確認できるはずです。

Sw1#sho spanning-tree bri

                                                   Hello  Max  Fwd
MST Instance                 Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
MST0             32768 (32768,   0) aabb.cc00.0400    2    20   15  mstp        
MST1             32769 (32768,   1) aabb.cc00.0400    2    20   15  mstp        
MST2             32770 (32768,   2) aabb.cc00.0400    2    20   15  mstp        

Sw2#sho spanning-tree bri

                                                   Hello  Max  Fwd
MST Instance                 Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
MST0             32768 (32768,   0) aabb.cc00.0100    2    20   15  mstp        
MST1             32769 (32768,   1) aabb.cc00.0100    2    20   15  mstp        
MST2             32770 (32768,   2) aabb.cc00.0100    2    20   15  mstp        

Sw3#sho spanning-tree bri

                                                   Hello  Max  Fwd
MST Instance                 Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
MST0             32768 (32768,   0) aabb.cc00.0500    2    20   15  mstp        
MST1             32769 (32768,   1) aabb.cc00.0500    2    20   15  mstp        
MST2             32770 (32768,   2) aabb.cc00.0500    2    20   15  mstp        

Sw4#sho spanning-tree bri

                                                   Hello  Max  Fwd
MST Instance                 Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
MST0             32768 (32768,   0) aabb.cc00.0300    2    20   15  mstp        
MST1             32769 (32768,   1) aabb.cc00.0300    2    20   15  mstp        
MST2             32770 (32768,   2) aabb.cc00.0300    2    20   15  mstp        

ここで、ROOT BRIDGE がどのスイッチであるかを確認します。

Sw1#sho spanning-tree root

                                        Root    Hello Max Fwd
MST Instance           Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
MST0             32768 aabb.cc00.0100         0    2   20  15  Et0/1           
MST1             32769 aabb.cc00.0100   2000000    2   20  15  Et0/1           
MST2             32770 aabb.cc00.0100   2000000    2   20  15  Et0/1           

Sw1 の eth0/1 に接続されているスイッチが ROOT BRIDGE のようです。
Sw1 の eth0/1 はSw2 に接続されているはずですが、確認します。

Sw1#sho cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                  D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
Sw2              Eth 0/1           138             R S I  Linux Uni Eth 0/1
Sw3              Eth 0/0           161             R S I  Linux Uni Eth 0/0

では、Sw2 で show spanning-tree root コマンドを実行してみます。

Sw2#sho span root        

                                        Root    Hello Max Fwd
MST Instance           Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
MST0             32768 aabb.cc00.0100         0    2   20  15                  
MST1             32769 aabb.cc00.0100         0    2   20  15                  
MST2             32770 aabb.cc00.0100         0    2   20  15                  

やはり、現在は、Sw2 が ROOT BRIDGE になっています。
さて、ここからが本番です。
先ずは、Sw1 を root primary にして、インスタンス1をSw3、インスタンス2 をSw2 が root secondary になるように設定します。

Sw1(config)#spanning-tree mst 1,2 root primary
Sw1(config)#end
Sw1#sho spanning-tree root

                                        Root    Hello Max Fwd
MST Instance           Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
MST0             32768 aabb.cc00.0100         0    2   20  15  Et0/1           
MST1             24577 aabb.cc00.0400         0    2   20  15                  
MST2             24578 aabb.cc00.0400         0    2   20  15                  
これで、Sw1 がMST1,2のROOT BRIDGE になりました。
Sw3 で mst1 がroot secondary,Sw2 で mst2 が root secondary になるように設定します。

Sw3(config)#spanning-tree mst 1 root secondary
Sw3(config)#end
Sw3#wri
Sw2(config)#spanning-tree mst 2 root secondary
Sw2(config)#end
Sw2#wri
Sw4で、それぞれの mst の ポートの状態を確認します。

Sw4#sho spanning-tree mst 1,2

##### MST1    vlans mapped:   101-105
Bridge        address aabb.cc00.0300  priority      32769 (32768 sysid 1)
Root          address aabb.cc00.0400  priority      24577 (24576 sysid 1)
              port    Et0/3           cost          4000000   rem hops 18

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/2            Altn BLK 2000000   128.3    P2p
Et0/3            Root FWD 2000000   128.4    P2p

##### MST2    vlans mapped:   201-205
Bridge        address aabb.cc00.0300  priority      32770 (32768 sysid 2)
Root          address aabb.cc00.0400  priority      24578 (24576 sysid 2)
              port    Et0/2           cost          4000000   rem hops 18

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Et0/2            Root FWD 2000000   128.3    P2p
Et0/3            Altn BLK 2000000   128.4    P2p
mst1 が左回り、mst2 が右回りにできました。

図に記入します。

お疲れさまです。spanning-tree については大体カバーしたと思いますので、またネタができたら投稿します。

ニックネーム たいちょう でした。次回をお楽しみに。

タグ: