GNS3 活用 - Cisco スイッチ STP 編 その9 (portfast BPDU Guard でセキュリティを考慮した運用を)
お疲れさまです。ニックネーム たいちょう です。
今回は、エッジポートにスイッチをぶら下げられないための対策をやってみます。前回(GNS3 活用 - Cisco スイッチ STP 編 その8 (PVSTP で負荷分散) )の続きです。
この図から始めます。
ここで、SW2がROOT BRIDGEで、Sw1は、オフィスにあるPCをぶら下げるのみにしているつもりです。
まずはこのトポロジをつくります。
細部の設定は省略します。
- Sw2 を root primary に、 Sw3 を root secondary に設定しました。
- それぞれのスイッチを結ぶラインを dot1qトランクに設定しました。
- Sw1 のfa1/14,fa1/15 に VLAN100 を収容しました。
- それぞれのスイッチで、ROOT PORT等の確認をしました。
- Sw1 を、portfast 設定しました。
さて、portfast なんですが、スイッチ全体で設定できます。
おそらく、トランクポート以外はBPU Guard が有効になるようです。
この設定だと面白くないので、fa1/14 と fa1/15 のみ portfast 設定してみます。
Sw1(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet1/14 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet1/15 but will only
have effect when the interface is in a non-trunking mode.
ここまでの作業を図にしてみます。
さて、ここからお楽しみです。
Sw1 に新たに、Bridge priority を 0 に設定したスイッチを接続します。
そのとき、それぞれのスイッチにどのような変化が表れるかを観察します。
Evil-Switch をpriority 65535 にして接続します。
ここで、Evil-Switch の priority を 0 にしてみます。
それぞれのスイッチで、spanning-tree の debug events をオンにします。
#debug spanning-tree events
思惑どおり、Evil-Switch が ROOT BRIDGE になってしまいました。
図に記入します。
では、Sw1 で対策をしてみます。
Sw1(config)#spanning-tree portfast bpduguard
Sw1#sho spanning-tree vlan 100 summ
Root bridge for VLAN100 is 8192.c402.2f19.0001.
PortFast BPDU Guard is enabled
UplinkFast is disabled
BackboneFast is disabled
Name Blocking Listening Learning Forwarding STP Active
-------------------- -------- --------- -------- ---------- ----------
VLAN100 1 0 0 4 5
ここで、Evil-Switch を再起動してみます。
Evil-Switch を停止します。
この段階で、Sw2が ROOT BRIDGE になりました。
Evel-Switch を再起動してみます。
これまでなら、Bridge priority が 0 の Evil-Switch が ROOT BRIDGE になるはずです。
再起動してみました。
あ、やはり、Evil-Switch がROOT BRIDGE になってしまいました。
どうやら、PortFast BPDU Guard は、trunk モードにしていると効かないようです。
- Evel-Switch を 停止します。
- 再度Sw1 の fa1/5 を switchport access にしておきます。
- Evil-Switch を 起動します。
今度は大丈夫でした。
図に記入します。
エッジポートには、PortFast BPDU Guard が有効なようです。
お疲れさまでした。ニックネーム たいちょう でした。
次回をお楽しみに。