現在位置: ホーム / みらくるブログ / GNS3 活用 - Cisco スイッチ STP 編 その1(基本形)

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

spanning-tree の技術をGNS3で検証するシリーズです。

お久しぶりです。

ニックネーム たいちょう です。
ブログを4ヶ月もお休みしていました。今年もよろしくお願いします。

去年始めたLinux実験室ですが、「OS、Web、ネットワーク、セキュリティ、障害」などの区分にしていましたが、今年は、もう少し細分化して掘り下げてみようと思います。

スタンスとしては、わたしがやってみたことを綴る感じですから、立派なものではありませんが、どこかしらみなさんの役に立つことがあれば幸いです。

さて、最近CCNAをリテイクして、さあ、CCNPを頑張って取ろうかなーと思っているんですが、そんな人も多いと思って、GNS3をまた始めたところです。

GNS3は、Cisco IOS をエミュレートしてくれます。使うのは、c3745 です。正規のルートで入手しましょう。3745 には、NM-16ESW モジュールがついています。これを使います。ただ、スイッチの勉強をするには、足りないところが多いと言われています。でも、ホームラボを持つのは、大変なので、GNS3を活用したいですね。

まずは以下のような接続にしてみます。これを基本形として、色々実験していきます。今回は、spanning-tree のステータス等を確認します。

確認事項

確認したいのは以下の事項です。

  1. 各スイッチでホストネームを設定する。図に記入する。
  2. それぞれの MAC アドレスを確認する。図に記入する。
  3. root bridge を確認する。 root bridge になっている理由を考える。図に記入する。
  4. 各スイッチのポートの状態を確認する。まず、全体をとらえてみる。図に記入する。
  5. 各スイッチのポートの状態を確認する。なぜその状態なのかを考える。図に記入する。

GNS3におけるコマンドですが、実際のCiscoのコマンドと少し違うところがあります。確認した結果、次の図を作りました。

確認した内容

確認したことを以下に記述しておきます。

1.

R1#conf t
R1(config)#hostname Sw1
Sw1(config)#end
Sw1#wri mem

R2,R3でも同様に設定する。

2.

Sw1#sh mac-address-table 
Destination Address  Address Type  VLAN  Destination Port
-------------------  ------------  ----  --------------------
c402.60c2.0000        Self          1        Vlan1    

Sw2#sh mac-address-table
Destination Address  Address Type  VLAN  Destination Port
-------------------  ------------  ----  --------------------
c403.60d0.0000        Self          1        Vlan1    

Sw3#sh mac-address-table
Destination Address  Address Type  VLAN  Destination Port
-------------------  ------------  ----  --------------------
c404.60df.0000        Self          1        Vlan1    

3.

Sw1#sh spanning-tree root
VLAN1            
  Root ID    Priority    32768
             Address     c402.60c2.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Sw2#sh spanning-tree root
VLAN1            
  Root ID    Priority    32768
             Address     c402.60c2.0000
             Cost        19
             Port        42 (FastEthernet1/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Sw3#sh spanning-tree root
VLAN1            
  Root ID    Priority    32768
             Address     c402.60c2.0000
             Cost        19
             Port        44 (FastEthernet1/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

RT BR は、Sw1 である。理由は、3つのスイッチの priority が同じで、Sw1 の MACアドレスの値が最小だからである。

4.

Sw1#sh spanning-tree summary
Root bridge for: VLAN1.
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 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        

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                1        0         0        1          2         
-------------------- -------- --------- -------- ---------- ----------
              1 VLAN 1        0         0        1          2         

Sw1 の2つのポートは、Forwarding state である。
Sw2 の2つのポートは、Forwarding state である。
Sw3 の1つのポートは、Forwarding state で、もうひとつのポートは、Blocking である。

Sw1#sh spanning-tree brie

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c402.60c2.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c402.60c2.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c402.60c2.0000 128.42
FastEthernet1/3      128.44   128    19 FWD     0 32768 c402.60c2.0000 128.44

Sw2#sh spanning-tree brie

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c402.60c2.0000
             Cost        19
             Port        42 (FastEthernet1/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c403.60d0.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c402.60c2.0000 128.42
FastEthernet1/2      128.43   128    19 FWD    19 32768 c403.60d0.0000 128.43

Sw3#sh spanning-tree brie

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c402.60c2.0000
             Cost        19
             Port        44 (FastEthernet1/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c404.60df.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/2      128.43   128    19 BLK    19 32768 c403.60d0.0000 128.43
FastEthernet1/3      128.44   128    19 FWD     0 32768 c402.60c2.0000 128.43

5.

Sw1#sh spanning-tree active

 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
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:03: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 forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.42.
   Designated root has priority 32768, address c402.60c2.0000
   Designated bridge has priority 32768, address c402.60c2.0000
   Designated port id is 128.42, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 133, received 3

 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 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 132, received 1

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 42 (FastEthernet1/1), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:47:30 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 32768, address c402.60c2.0000
   Designated bridge has priority 32768, address c402.60c2.0000
   Designated port id is 128.42, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 2, received 1441

 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 c403.60d0.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: 1
   BPDU: sent 1443, received 1

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 0 last change occurred 00:28:01 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 blocking
   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 c403.60d0.0000
   Designated port id is 128.43, designated path cost 19
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 0
   BPDU: sent 1, received 842

 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.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 840

お疲れさまです。次はROOT BRIDGE の変更をやってみます。

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

 

タグ: