現在位置: ホーム / みらくるブログ / GNS3 活用 - Cisco スイッチ STP 編 その2(root bridge の変更)

GNS3 活用 - Cisco スイッチ STP 編 その2(root bridge の変更)

VLAN 1 のルート・ブリッジを変更してみます。

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

前回は、STPの基本形をやってみました。

GNS3 活用 - Cisco スイッチ STP 編 その1(基本形)

今日は、VLAN 1 のルート・ブリッジを変更して、トポロジにどんな変化が出るか観察します。

タスク1.(root bridge の変更および確認)

  • Sw3 の spanning-tree のデバッグモードの events をオンにする。
  • Sw1 と S2 間のラインを切断する。
  • Sw3 と Sw2 のポートの状態を確認する。
  • Sw3 の spanning-tree のデバッグモードの events をオフにする。
  • Sw2とSw3で、状態の変化を観察する。
  • Sw3 の spanning-tree のデバッグモードの events をオフにする。
  • 理由を考える。
  • 図に記入する。

 

記入した結果です。

作業記録です。

1.
Sw3#debug spanning-tree events
Spanning Tree event debugging is on
--
Sw2#conf t
Sw2(config)#int fa1/2
Sw2(config-if)#int fa1/1
Sw2(config-if)#shut
Sw2(config-if)#
*Mar  1 00:04:28.827: %LINK-5-CHANGED: Interface FastEthernet1/1, changed state to administratively down
*Mar  1 00:04:29.827: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to down
--
*Mar  1 00:04:26.847: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--1回目(2秒経過)
*Mar  1 00:04:26.847: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:28.839: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--2回目(4秒経過)
*Mar  1 00:04:28.839: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:30.843: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--3回目(6秒経過)
*Mar  1 00:04:30.843: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:32.847: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--4回目(8秒経過)
*Mar  1 00:04:32.847: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:34.839: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--5回目(10秒経過)
*Mar  1 00:04:34.839: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:36.843: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--6回目(12秒経過)
*Mar  1 00:04:36.843: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:38.843: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--7回目(14秒経過)
*Mar  1 00:04:38.843: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:40.839: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--8回目(16秒経過)
*Mar  1 00:04:40.839: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:42.843: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2 ★★<--9回目(18秒経過)
*Mar  1 00:04:42.843: current Root has 32768-c402.60c2.0000
Sw3#
*Mar  1 00:04:44.607: STP: VLAN1 Fa1/2 -> listening ★★<-10回目(20秒経過)
*Mar  1 00:04:44.835: STP: VLAN1 heard root 32768-c403.60d0.0000 on Fa1/2
*Mar  1 00:04:44.835: current Root has 32768-c402.60c2.0000
*Mar  1 00:04:44.847: STP: VLAN1 Topology Change rcvd on Fa1/2
*Mar  1 00:04:44.847: STP: VLAN1 sent Topology Change Notice on Fa1/3
Sw3#
*Mar  1 00:04:59.607: STP: VLAN1 Fa1/2 -> learning ★★<--15秒経過(35秒経過)
Sw3#
*Mar  1 00:05:14.607: STP: VLAN1 sent Topology Change Notice on Fa1/3
*Mar  1 00:05:14.607: STP: VLAN1 Fa1/2 -> forwarding ★★<--15秒経過(50秒経過)
Sw3#sh spanning-tree active  

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c404.60df.0000
  Configured hello time 2, max age 20, forward delay 15

50秒で converge したのは、hello time が2秒、max age が20秒、forward delay が 15秒であるため。 


...(snip)...
Sw3#sh spanning-tree summary
Root bridge for: none.
PortFast BPDU Guard is disabled
UplinkFast is disabled
BackboneFast is disabled

Name                 Blocking Listening Learning Forwarding STP Active
-------------------- -------- --------- -------- ---------- ----------
VLAN1                0        0         0        2          2         
-------------------- -------- --------- -------- ---------- ----------
              1 VLAN 0        0         0        2          2         

--
Sw2#sh spanning-tree active

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c403.60d0.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 32768, address c402.60c2.0000
  Root port is 43 (FastEthernet1/2), cost of root path is 38
  Topology change flag not set, detected flag not set
  Number of topology changes 4 last change occurred 00:22:11 ago
          from FastEthernet1/1
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 43 (FastEthernet1/2) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.43.
   Designated root has priority 32768, address c402.60c2.0000
   Designated bridge has priority 32768, address c404.60df.0000
   Designated port id is 128.43, designated path cost 19
   Timers: message age 3, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 31, received 659
--
Sw3#sh spanning-tree active  

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c404.60df.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 32768, address c402.60c2.0000
  Root port is 44 (FastEthernet1/3), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 4 last change occurred 00:18:43 ago
          from FastEthernet1/2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 43 (FastEthernet1/2) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.43.
   Designated root has priority 32768, address c402.60c2.0000
   Designated bridge has priority 32768, address c404.60df.0000
   Designated port id is 128.43, designated path cost 19
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 2
   BPDU: sent 608, received 108

 Port 44 (FastEthernet1/3) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.44.
   Designated root has priority 32768, address c402.60c2.0000
   Designated bridge has priority 32768, address c402.60c2.0000
   Designated port id is 128.44, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 4, received 720

Sw3#undebug spanning-tree events
Spanning Tree event debugging is off

タスク2.

  • 1.の状態から、Sw1,2,3 の spanning-tree のデバッグモードの events をオンにする。
  • Sw3 の priority を変更して、ROOT BRIDGE にする。
  • 状態の変化を観察する。
  • 理由を考える。
  • 図に記入する。

 

記入した結果です。

作業記録です。 

Sw1#debug spanning-tree events 
Spanning Tree event debugging is on
--
Sw2#debug spanning-tree events
Spanning Tree event debugging is on
--
Sw3#debug spanning-tree events
Spanning Tree event debugging is on
--
Sw3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Sw3(config)#spann
Sw3(config)#spanning-tree vl
Sw3(config)#spanning-tree vlan 1 priority 4096
Sw3(config)#
*Mar  1 00:21:39.671: STP: VLAN1 we are the spanning tree root
--
*Mar  1 00:21:39.683: STP: VLAN1 heard root  4096-c404.60df.0000 on Fa1/3
*Mar  1 00:21:39.683: current Root has 32768-c402.60c2.0000
*Mar  1 00:21:39.683:     supersedes 32768-c402.60c2.0000
*Mar  1 00:21:39.683: STP: VLAN1 new root is 4096, c404.60df.0000 on port Fa1/3, cost 19
--
*Mar  1 00:21:39.679: STP: VLAN1 heard root  4096-c404.60df.0000 on Fa1/2
*Mar  1 00:21:39.679: current Root has 32768-c402.60c2.0000
*Mar  1 00:21:39.679:     supersedes 32768-c402.60c2.0000
*Mar  1 00:21:39.679: STP: VLAN1 new root is 4096, c404.60df.0000 on port Fa1/2, cost 19
説明:
Sw3 の VLAN 1 の priority を Sw1 より低くしたことにより、Sw3 が VLAN 1 の ROOT BRIDGE になった。
Sw1,Sw2 が Sw3 を VLAN 1 の ROOT BRIDGEにした。

NDPが変更になることを確認すること

  • Sw1 と Sw2 間のラインを接続する。
  • Sw1,Sw2,Sw3で、状態の変化を観察する。
  • 理由を考える。
  • 図に記入する。

 

記入した結果です。

作業記録です。


Sw2(config-if)#no shut
Sw2(config-if)#end
Sw2#
*Mar  1 00:08:21.935: STP: VLAN1 Fa1/1 -> listening
*Mar  1 00:08:22.775: STP: VLAN1 Fa1/1 -> blocking
Sw2#
*Mar  1 00:08:22.971: %SYS-5-CONFIG_I: Configured from console by console
Sw2#
*Mar  1 00:08:24.899: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
--
Sw2#sh spanning-tree act

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c403.60d0.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 4096, address c404.60df.0000
  Root port is 43 (FastEthernet1/2), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 3 last change occurred 00:16:53 ago
          from FastEthernet1/1
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 42 (FastEthernet1/1) of VLAN1 is blocking
   Port path cost 19, Port priority 128, Port Identifier 128.42.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 32768, address c402.60c2.0000
   Designated port id is 128.42, designated path cost 19
   Timers: message age 3, forward delay 0, hold 0
   Number of transitions to forwarding state: 0
   BPDU: sent 1, received 282

 Port 43 (FastEthernet1/2) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.43.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.43, designated path cost 0
   Timers: message age 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 35, received 504
--
Sw1#sh spanning-tree acti    

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c402.60c2.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 4096, address c404.60df.0000
  Root port is 44 (FastEthernet1/3), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:11:41 ago
          from FastEthernet1/1
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 42 (FastEthernet1/1) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.42.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 32768, address c402.60c2.0000
   Designated port id is 128.42, designated path cost 19
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 368, received 4

 Port 44 (FastEthernet1/3) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.44.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.44, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 187, received 185
--
Sw3#sh spanning-tree vlan 1 act

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 4096, address c404.60df.0000
  Configured hello time 2, max age 20, forward delay 15
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 3 last change occurred 00:13:28 ago
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 43 (FastEthernet1/2) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.43.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.43, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 563, received 35

 Port 44 (FastEthernet1/3) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.44.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.44, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 407, received 187
--
Sw1#wr
Sw2#wr
Sw3#wr

タスク3.

  • 再度 NDP が変化することを確認する。
  • 2.の状態から、Sw2 の VLAN1 の priority を 8192 にする。
  • 状態の変化を観察する。
  • 理由を考える。
  • 図に記入する。

記入した結果です。

作業記録です。

Sw2#conf t
Sw2(config)#spanning-tree vlan 1 priority 8192
Sw2(config)#en
*Mar  1 00:04:36.139: STP: VLAN1 Fa1/1 -> listening
Sw2(config)#end
Sw2#
*Mar  1 00:04:37.663: %SYS-5-CONFIG_I: Configured from console by console
Sw2#
*Mar  1 00:04:51.139: STP: VLAN1 Fa1/1 -> learning
Sw2#
*Mar  1 00:05:06.139: STP: VLAN1 sent Topology Change Notice on Fa1/2
*Mar  1 00:05:06.139: STP: VLAN1 Fa1/1 -> forwarding

Sw1#
*Mar  1 00:04:37.843: STP: VLAN1 sent Topology Change Notice on Fa1/3
*Mar  1 00:04:37.843: STP: VLAN1 Fa1/1 -> blocking

Sw3#
*Mar  1 00:04:37.851: STP: VLAN1 Topology Change rcvd on Fa1/3
Sw3#
*Mar  1 00:05:06.159: STP: VLAN1 Topology Change rcvd on Fa1/2

Sw2#sh spanning-tree act

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 8192, address c403.60d0.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 4096, address c404.60df.0000
  Root port is 43 (FastEthernet1/2), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:04:36 ago
          from FastEthernet1/1
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 42 (FastEthernet1/1) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.42.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 8192, address c403.60d0.0000
   Designated port id is 128.42, designated path cost 19
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 155, received 137

 Port 43 (FastEthernet1/2) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.43.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.43, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 1, received 289

Sw1#sh spanning-tree act

 VLAN1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c402.60c2.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 4096, address c404.60df.0000
  Root port is 44 (FastEthernet1/3), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 2 last change occurred 00:07:15 ago
          from FastEthernet1/1
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 42 (FastEthernet1/1) of VLAN1 is blocking
   Port path cost 19, Port priority 128, Port Identifier 128.42.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 8192, address c403.60d0.0000
   Designated port id is 128.42, designated path cost 19
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 137, received 220

 Port 44 (FastEthernet1/3) of VLAN1 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.44.
   Designated root has priority 4096, address c404.60df.0000
   Designated bridge has priority 4096, address c404.60df.0000
   Designated port id is 128.44, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 2, received 355

適切なコマンドを実行する事で、変更や確認ができることがわかりました。

次回は、パスコストを変化させてみたいと思います。

お疲れさまでした。第2日目の終了です。

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

タグ: