PortFast
NOTE
- グローバル設定でspanning-tree portfast default にするとアクセスポートで有効
- トランクポートはIFレベルコマンドでしか指定できない
- 推奨はIFレベル設定
- そのポート上でどのVLANがPortfastが有効化を調べるには show spanning-tree int XXXX portfast
SW1(config)#int fa0/19 SW1(config-if)#spanning-tree portfast trunk SW1#show spanning-tree int fa0/19 portfast VLAN0001 enabled VLAN0002 enabled SW1#show spanning-tree vlan 2 int fa0/19 detail Port 19 (FastEthernet0/19) of VLAN0002 is forwarding Port path cost 19, Port priority 128, Port Identifier 128.19. Designated root has priority 0, address 0019.aa6c.7bb3 Designated bridge has priority 4098, address 0009.e8c2.7000 Designated port id is 128.19, designated path cost 19 Timers: message age 0, forward delay 0, hold 0 Number of transitions to forwarding state: 1 The port is in the portfast mode by portfast trunk configuration Link type is point-to-point by default BPDU: sent 2322, received 2
ポートタイプの指定はポートの接続先デバイスによって異なる。
- edge
レイヤ 2 ホストに接続し、アクセスポートまたはトランクポートに設定できる。 - network
ネットワークポートはレイヤ 2 スイッチまたはブリッジだけに接続する。 - normal (デフォルト)
normalポートはエッジでもネットワークでもない、通常のスパニングツリーポート。
これらのポートはどのデバイスにも接続できる。
Switch(config)#spanning-tree portfast ? edge Spanning tree portfast edge options network Spanning tree portfast network options normal Spanning tree portfast normal options Switch(config)#spanning-tree portfast normal ? default Enable normal behavior by default on all ports Switch(config)#spanning-tree portfast network ? default Enable portfast network by default on all ports Switch(config)#spanning-tree portfast edge ? bpdufilter Enable portfast edge bpdu filter on this switch bpduguard Enable portfast edge bpdu guard on this switch default Enable portfast edge by default on all access ports Switch(config-if)#spanning-tree portfast ? disable Disable portfast for this interface edge Enable portfast edge on the interface network Enable portfast network on the interface
UplinkFast
NOTE
Switch(config)#spanning-tree uplinkfast ? max-update-rate Rate at which station address updates are sent <cr>
- 設定はルートブリッジ以外に入れる(SW2,SW3,SW4に入れる)
- 確実性を増すために自動でSTPパラメータが非優先な内容に変更される。プライオリティ49152に変更、ポートコスト3000を追加。
- 設定はどのSWでも入れられるが、回線断時にUplinkfast が機能するのはNDPのあるSWだけ。
- インタフェース単位の設定はできず、グローバル設定のみ
- これを入れたSWにRoot Guard を設定してはいけない。
- SW3のfa0/3を抜くと、ほぼ即座にSW4で切り替わるが、SW1のfa0/0を抜いてもSW2は通常の変遷を経て切り替わる。
- MACアドレステーブルが不一致になったままなのでダミーのマルチキャストパケットを送信してテーブルを書き換えさせる。
- この時に1秒あたり何個のパケットを送るかを指定できる(spanning-tree uplinkfast max-update-rate)
Switch(config)#spanning-tree uplinkfast max-update-rate ? <0-32000> Maximum number of update packets per second
- STPはBPDUをRBが生成する。
⇒ RB以外のSWは必ず一つのRPを持つ。
⇒ RB以外のSWはBPDUを受信するのはRPかNDPになるはず。
⇒ RBに向かうのはRPとNDPのどちらかしかないはずなので、RP側リンクがダウンしたのであればNDPにいきなり切り替えてもループは起きないはず(Listen、Learnを省略)
BackboneFast
NOTE
- ルートブリッジ、非ルートブリッジ全てのSWで設定が必要
Switch(config)#spanning-tree backbonefast ? <cr>
- SW1とSW2間の間接リンクに障害が発生
- 検知したSW2は自分をルートとしたBPDUをSW3に送る
- SW3は本来のSW1のBPDUよりも下位のBPDUをSW2から受信することで異常の発生を理解
- SW3はSW1にRoot Link Queryを送り、RB(ルートブリッジ)の正常性を確認する
- SW1(RB)はRLQ ACKを返す
- SW3はSW2経由のSW1のBPDU MAX Age待たずに切り替えを実行する(Listeningになる)
- SW3のfa0/1はNDPからDPになる
BPDU Guard
NOTE
Switch(config)#spanning-tree portfast bpduguard default Switch(config-if)#spanning-tree bpduguard enable
- 受信したらErrDisabledになり、ポート無効
- 一定時間後に解除
Switch(config)#errdisable recovery cause bpduguard Switch(config)#errdisable recovery interval 120
- BPDUガードとBPDUフィルタを同時に使用すると、BPDUフィルタが優先される
- 機能有無の確認
Switch#show spanning-tree summary Switch is in pvst mode Root bridge for: none Extended system ID is enabled Portfast Default is enabled PortFast BPDU Guard Default is enabled Portfast BPDU Filter Default is disabled Loopguard Default is disabled EtherChannel misconfig guard is enabled UplinkFast is disabled BackboneFast is disabled Configured Pathcost method used is short Name Blocking Listening Learning Forwarding STP Active ---------------------- -------- --------- -------- ---------- ---------- Total 0 0 0 0 0 Switch#
- ポートタイプを選択する場合はedgeのみ
Switch(config-if)#spanning-tree bpduguard ? disable Disable BPDU guard for this interface enable Enable BPDU guard for this interface Switch(config)#spanning-tree portfast edge ? bpdufilter Enable portfast edge bpdu filter on this switch bpduguard Enable portfast edge bpdu guard on this switch default Enable portfast edge by default on all access ports Switch(config)#spanning-tree portfast edge bpduguard ? default Enable bpdu guard by default on all portfast edge ports Switch(config)#spanning-tree portfast network ? default Enable portfast network by default on all ports Switch(config)#spanning-tree portfast normal ? default Enable normal behavior by default on all ports
BPDU Filter
NOTE
IFレベル
- BPDUを送信しない
- BPDUを受信したら破棄する
- ループの可能性があるので推奨しない
Switch(config-if)#spanning-tree bpdufilter enable
グローバルレベル
- IFのUp直後にBPDUを1つ、その後、Hello毎(2秒)にMaxAge時間の間(20秒)。つまり10個、合計11個のBPDUを送信する。
- その間にBPDUを受信したら通常の変遷を経てSTPポートになる。受信しなければそのままBPDUを送信しないポートになる。
Switch(config)#spanning-tree portfast bpdufilter default
- ポートタイプを選択する場合はedgeのみ
Switch(config)#spanning-tree portfast edge bpdufilter ? default Enable bdpu filter by default on all portfast edge ports Switch(config)#spanning-tree portfast edge bpdufilter default ? Switch(config)#spanning-tree portfast network ? default Enable portfast network by default on all ports Switch(config)#spanning-tree portfast normal ? default Enable normal behavior by default on all ports
Loop Guard
NOTE
- グローバルでの設定を推奨
- BPDUを受信できないことによる切り替わりがループを作ってしまうことを回避する(主に設定ミス)
- 本来BPDUを受信すべきポートはRPとNDP。BPDUをMaxAge受信できないと、障害が起きたと判断して切り替わりに移るがLoop Guard を入れておくと、loop inconsistent になるだけで切り替わりは起きない
Switch(config)#spanning-tree loopguard ? default Enable loopguard by default on all ports Switch(config)#spanning-tree loopguard default ? <cr> Switch(config)#interface gigabitEthernet 0/0 Switch(config-if)#spanning-tree guard ? loop Set guard mode to loop guard on interface none Set guard mode to none root Set guard mode to root guard on interface Switch(config-if)#spanning-tree guard loop ? <cr>
- 本当の障害によりBPDUを受信できない場合もあるのでは?SW1-SW2の時に困るのでは?
⇒ SW3からすると、SW1-SW3、SW2-SW3の障害は検知できる。SW1-SW2の障害はSW1が検知でき、トポロジが変わったことをSW3に通知できる
Root Guard
NOTE
Switch(config-if)#spanning-tree guard root
- UplinkFastを入れたSWに設定してはいけない
- DPがRPになるような計算が起きると、root inconsistant
DIAGRAM
SW1 Priority 0
SW2 Priority 4096
[SW2] RootBridge / | / | / | (Fa1/0/2) / | (Fa1/0/1) / | / | / | 【SW1】-----[SW4]------[SW3] (Fa1/0/24) (Fa1/0/3)
VERIFICATION
- SW1をイレギュラーな接続と想定
SW4#sh spa v 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 4097 Address 001a.6dbc.4a00 Cost 19 Port 4 (FastEthernet1/0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0014.f2a8.4800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Root FWD 19 128.4 P2p Fa1/0/3 Altn BLK 19 128.5 P2p SW4# *Mar 1 00:28:34.606: set portid: VLAN0001 Fa1/0/24: new port id 801A *Mar 1 00:28:34.606: STP: VLAN0001 Fa1/0/24 -> listening SW4# *Mar 1 00:28:36.611: %LINK-3-UPDOWN: Interface FastEthernet1/0/24, changed state to up SW4# *Mar 1 00:28:38.607: set portid: VLAN0001 Fa1/0/24: new port id 801A *Mar 1 00:28:38.607: STP: VLAN0001 Fa1/0/24 -> listening *Mar 1 00:28:39.597: STP: VLAN0001 heard root 1-0009.e8c2.7000 on Fa1/0/24 *Mar 1 00:28:39.597: supersedes 4097-001a.6dbc.4a00 *Mar 1 00:28:39.597: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port FastEthernet1/0/24 on VLAN0001. *Mar 1 00:28:39.597: STP: VLAN0001 Fa1/0/24 -> blocking SW4# *Mar 1 00:28:39.614: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/24, changed state to up SW4# *Mar 1 00:28:41.602: STP: VLAN0001 heard root 1-0009.e8c2.7000 on Fa1/0/24 *Mar 1 00:28:41.602: supersedes 4097-001a.6dbc.4a00 SW4# *Mar 1 00:28:43.598: STP: VLAN0001 heard root 1-0009.e8c2.7000 on Fa1/0/24 *Mar 1 00:28:43.598: supersedes 4097-001a.6dbc.4a00 SW4#sh spa v 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 4097 Address 001a.6dbc.4a00 Cost 19 Port 4 (FastEthernet1/0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0014.f2a8.4800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Root FWD 19 128.4 P2p Fa1/0/3 Altn BLK 19 128.5 P2p Fa1/0/24 Desg BKN*19 128.26 P2p *ROOT_Inc SW4# *Mar 1 00:28:55.602: STP: VLAN0001 heard root 1-0009.e8c2.7000 on Fa1/0/24 *Mar 1 00:28:55.602: supersedes 4097-001a.6dbc.4a00 SW4# *Mar 1 00:29:05.602: STP: VLAN0001 heard root 1-0009.e8c2.7000 on Fa1/0/24 *Mar 1 00:29:05.602: supersedes 4097-001a.6dbc.4a00 SW4# *Mar 1 00:29:08.085: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/24, changed state to down SW4# *Mar 1 00:29:09.100: %LINK-3-UPDOWN: Interface FastEthernet1/0/24, changed state to down SW4#sh spa v 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 4097 Address 001a.6dbc.4a00 Cost 19 Port 4 (FastEthernet1/0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0014.f2a8.4800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Root FWD 19 128.4 P2p Fa1/0/3
コメント