【FortiGate】ハードウェアスイッチの STP 動作を検証する

ファイアウォール(UTM)

作業環境

  • FortiGate 60E
    • version 6.4.6

はじめに

FortiGate では、複数のポートをグループ化してハブのように動作するハードウェアスイッチという機能があります。

ハードウェアスイッチでは STP を動作させることができるため、その動作を検証してみます。

なお、ハードウェアスイッチと似た機能でソフトウェアスイッチという機能がありますが、ソフトウェアスイッチでは STP をサポートしていません。

検証構成

検証構成はこちらです。

FortiGate では internal1,2 をメンバーとするハードウェアスイッチを作成します。

そして FortiGate のハードウェアスイッチの各ポートを Cisco の L2SW (C2960) の Vlan 30 アクセスポートに接続します。

なお、L2SW の STP 設定はモードを rapid-pvst に変更し、またプライオリティを 4096 として L2SW がルートブリッジになるようにしておきます。

FortiGate 設定

ハードウェアスイッチの設定

ハードウェアスイッチの設定は以下の通りです。適当な IP アドレスを設定しておきます。

設定後の CLI コンフィグは以下の通りです。

config system virtual-switch
    edit "HWSW-Vlan30"
        set physical-switch "sw0"
        config port
            edit "internal1"
            next
            edit "internal2"
            next
        end
    next
end

config system interface
    edit "HWSW-Vlan30"
        set vdom "root"
        set ip 10.1.30.254 255.255.255.0
        set allowaccess ping https ssh http
        set type hard-switch
        set lldp-transmission enable
        set role lan
        set snmp-index 14
    next
end

ハードウェアスイッチの STP 有効化

ハードウェアスイッチの STP はデフォルトで無効です。有効化するためには CLI のインターフェース設定で以下のように設定します。

config system interface
    edit "HWSW-Vlan30"
        set stp enable
    next
end

この設定によって、ハードウェアスイッチが BPDU を送信するようになります。

STP パラメータの設定

STP パラメータの設定は config system stp で行います。

デフォルトでは以下のような設定値となっています。

FortiGate-60E # show full-configuration system stp
config system stp
    set switch-priority 32768
    set hello-time 2
    set forward-delay 15
    set max-age 20
    set max-hops 20
end

FortiGate-60E (stp) # set
switch-priority    STP switch priority; the lower the number the higher the priority (select from 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, and 57344).
hello-time         Hello time (1 - 10 sec, default = 2).
forward-delay      Forward delay (4 - 30 sec, default = 15).
max-age            Maximum packet age (6 - 40 sec, default = 20).
max-hops           Maximum number of hops (1 - 40, default = 20).

STP の状態確認

STP パラメータ設定確認

  • get system stp
FortiGate-60E # get system stp
switch-priority     : 32768
hello-time          : 2
forward-delay       : 15
max-age             : 20
max-hops            : 20

STP 状態確認

  • get system stp list
FortiGate-60E # get system stp list

bridge 'HWSW-Vlan30'  prio 32768  mac 04:D5:90:07:F6:01  vd 'root'
  root prio 4126  mac 00:22:0C:BE:79:80  cost 200000
  port 'internal1'  role root  state forward  cost 200000  edge no  rx 131  tx 2268
  port 'internal2'  role alternate  state listen  cost 200000  edge no  rx 113  tx 2236

diagnose 系コマンド

FortiGate-60E # diagnose sys stp
bridge     Display STP details for one or more bridges.
info       Display STP information.
time       Measure STP times.
log        Debug log.
restart    Restart the STP process

  • diagnose sys stp bridge info
FortiGate-60E # diagnose sys stp bridge info
stp.vd.root.bridge.HWSW-Vlan30.our.priority: 32768
stp.vd.root.bridge.HWSW-Vlan30.our.mac: 04:D5:90:07:F6:01
stp.vd.root.bridge.HWSW-Vlan30.root.priority: 4126
stp.vd.root.bridge.HWSW-Vlan30.root.mac: 00:22:0C:BE:79:80
stp.vd.root.bridge.HWSW-Vlan30.pdu.rx.count: 456
stp.vd.root.bridge.HWSW-Vlan30.pdu.rx.fail: 0
stp.vd.root.bridge.HWSW-Vlan30.pdu.rx.runt: 0
#以下略

L2SW 側の STP 状態確認

lanSW#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol rstp
  Root ID    Priority    4126
             Address     0022.0cbe.7980
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4126   (priority 4096 sys-id-ext 30)
             Address     0022.0cbe.7980
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/5               Desg FWD 19        128.5    P2p
Fa0/6               Desg FWD 19        128.6    P2p
Fa0/7               Desg FWD 19        128.7    P2p Edge

障害試験

端末から FortiGate のハードウェアスイッチへ Ping を飛ばしつつ、FWD 側のリンクに障害を発生させてみます。

障害発生時は Ping 1,2 欠け程度でした。RSTP の動作になっていることが分かります。

●障害時の FortiGate の STP 状態

FortiGate-60E # get system stp list

bridge 'HWSW-Vlan30'  prio 32768  mac 04:D5:90:07:F6:01  vd 'root'
  root prio 4126  mac 00:22:0C:BE:79:80  cost 200000
  port 'internal1'  down
  port 'internal2'  role root  state forward  cost 200000  edge no  rx 167  tx 2237

ちなみに L2SW のモードを rapid-pvst から pvst に変更すると、しっかり 30 秒通信断します。

ハードウェアスイッチの STP を無効にしていた場合

ハードウェアスイッチの STP を無効にしていた場合、FortiGate は BPDU を送信せず、STP に参加しなくなります。L2SW 側では STP 設定に基づいて FWD/BLK が形成され、動作としては STP の動作となり障害時には 30 秒の通信断が発生しました。

●FortiGate 側で STP 無効時の L2SW の STP 状態

lanSW#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol rstp
  Root ID    Priority    4126
             Address     0022.0cbe.7980
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4126   (priority 4096 sys-id-ext 30)
             Address     0022.0cbe.7980
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/5               Desg FWD 19        128.5    P2p
Fa0/6               Back BLK 19        128.6    P2p
Fa0/7               Desg FWD 19        128.7    P2p Edge

なお検証構成の場合、L2SW の Fa0/5 と Fa0/6 は FortiGate のハードウェアスイッチを介して L2 接続している状態であり、互いの BPDU を受信し合っているため FWD/BLK が形成されたと思われます。

参考資料

Hardware switch | Administration Guide
config system stp | CLI Reference
config system interface | CLI Reference
Technical Tip: STP forwarding
DescriptionThisarticledescribeshowtoparameter'STPforwarding'.SolutionAFortiGatedoesnotparticipateintheSpanningTreeProtocol(STP).STPisanIEEE802.1protocolthatensu...

タイトルとURLをコピーしました