こんにちは たそ(@taso_int)です。就活ですが、無事内定をいただきました。
今後はブログでの発信を活発化していきたいと思います。
専門学校でやってることって気になるかと思うので、ちょっと授業で扱ったSTPについて書こうかなと思います(レポートのほぼ写しかも)
1. 背景
STPとはSpanning Tree Protocol (スパニングツリープロトコル) の略で、Ethernet の経路冗長化の技術です。今回はCiscoのスパニングツリーで設定可能なRapid PVST+を実装します。Rapid PVST+ は、VLAN ごとに実装されている IEEE 802.1w(RSTP)規格で、STPの1 つのインスタンスは、設定されている各 VLAN で実行します。
2.目的
Ciscoのスパニングツリーで設定可能なRapid PVST+を実装します。
3.トポロジ図およびネットワークアドレス(見づらくてすいません)
4.環境
今回はCisco Packet Tracer (ver 7.3.0)を使用しています
5.実行手順結果等
基本設定後にshow spanning-treeコマンドを入力します。
S1
S1#show spanning-tree
VLAN0001
Root ID Priority 32769
Address 0009.7C72.981A
Cost 19
Port 3(FastEthernet0/3)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 000C.CF08.44ED
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/3 Root FWD 19 128.3 P2p
結果を見るにS3がルートブリッジの予感
S3
S3#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0009.7C72.981A
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 0009.7C72.981A
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3 Desg FWD 19 128.3 P2p
Fa0/1 Desg FWD 19 128.1 P2p
This bridge is the rootと書かれているためデフォルトのSTPではS3がルートブリッジだとわかります。
STPモードをRapid PVST+に設定するため下のコマンドを各スイッチに設定します。
S? (config)# spanning-tree mode rapid-pvst
VLAN1、99のプライマリルートブリッジをS1、セカンダリールートブリッジをS2に設定します。
今回はプライオリティ値を変更する方法を行います。S1のプライオリティ値を4096として、S2のプライオリティ値を8192とします。
VLAN 1、99におけるS1のプライオリティ値を4096にします。
S1 (config)# spanning-tree vlan 1 priority 4096
S1 (config)# spanning-tree vlan 99 priority 4096
VLAN 1、99におけるS2のプライオリティ値を8192にします。
S2 (config)# spanning-tree vlan 1 priority 8192
S2 (config)# spanning-tree vlan 99 priority 8192
show spanning-treeで確認しましょう
S1#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 4097
Address 000C.CF08.44ED
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)
Address 000C.CF08.44ED
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/3 Desg FWD 19 128.3 P2p
VLAN0099
Spanning tree enabled protocol rstp
Root ID Priority 4195
Address 000C.CF08.44ED
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4195 (priority 4096 sys-id-ext 99)
Address 000C.CF08.44ED
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/3 Desg FWD 19 128.3 P2p
上記のshow結果からして、S1はVLAN1でプライオリティ値が4097、VLAN99でプライオリティ値が4195となり、どちらもThis bridge is the rootと表記されているためプライマリルートブリッジとなっていることがわかります。
ルートブリッジとは何かと、なぜコマンドの値とプライオリティ値が異なっている理由について次回、詳しくまとめてみたいです。
ここまで読んでいただきありがとうございます。