1. はじめに
http://qiita.com/jinnai73/items/12e84c175dc5a9b600b1
の番外編です。スイッチ2台でループ構成を作ってBLKポートにportfast
を設定しても何も起こりませんでした。今回はケーブルの抜き差しを含めてもう一度検証していきます。
ネタバレ:起きない
2. 構成
Vlanはデフォルト設定、RPVSTを有効にしてprioirity設定のみ入れておきます。
Switch(config)#hostname tc0001
tc0001(config)#span mode rapid
tc0001(config)#span vlan 1-4094 priority 0
Switch(config)#hostname tc0002
tc0001(config)#span mode rapid
tc0001(config)#span vlan 1-4094 priority 4096
この状態で、tc0001がroot bridge、tc0002のFa1/0/2がブロッキングポートになっているはずですので確認します。
tc0001#sh span vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address 0016.4779.5500
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 1 (priority 0 sys-id-ext 1)
Address 0016.4779.5500
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa1/0/1 Desg FWD 19 128.3 P2p
Fa1/0/2 Desg FWD 19 128.4 P2p
tc0002#sh span vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address 0016.4779.5500
Cost 19
Port 3 (FastEthernet1/0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)
Address 0015.6256.6300
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa1/0/1 Root FWD 19 128.3 P2p
Fa1/0/2 Altn BLK 19 128.4 P2p
問題なさそうですね。では全ポートに対してportfastを設定してみます。
tc0001(config)#int range fa1/0/1 - 2
tc0001(config-if-range)#span portfast
tc0002(config)#int range fa1/0/1 - 2
tc0002(config-if-range)#span portfast
tc0002(config-if-range)#end
tc0002#
tc0002#
tc0002#
tc0002#sh span vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 1
Address 0016.4779.5500
Cost 19
Port 3 (FastEthernet1/0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)
Address 0015.6256.6300
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa1/0/1 Root FWD 19 128.3 P2p
Fa1/0/2 Altn BLK 19 128.4 P2p
tc0002#
ブロッキングのままですね。
3.結論
portfastを入れてもSTPが有効になっていればループは起きません。といってもスイッチ間ではuplinkfastがあるため、敢えてportfastを入れる理由も無いのですが、portfast恐怖症に陥る必要は無さそうです。
全ポートでportfastを有効にするspanning-tree portfast default
というコマンドもありますが、さすがにCiscoは推奨していません。
http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst6500/ios/12-2SX/best/practices/recommendations.html#wp1061957