今回は FortiGate の link-monitor
(リンクモニタ)という機能を検証します。
FortiGate における link-monitor とは、指定したルート上に異常がないかを監視し、ルート上に問題が発生した場合はルートをバックアップルートに切り替えるという機能です。
ネットワーク構成
今回の検証環境となるネットワークの構成は以下の通りです。

使用する FortiGate については以下の通りです。
- 機種:FortiGate 60E
- ファームウェアバージョン: v6.0.6 build0272 (GA)
通信経路について
FortiGate にて、以下の画像の通り 2 つのデフォルトルートを設定しています。

正常時はアドミニストレーティブ・ディスタンスの小さい 10.1.50.254 (メインルータ) を通るルートが使用されます。

ここで、メインルータの無線 AP 側リンクで障害が発生した場合、FortiGate は障害発生に気づかず 10.1.50.254 へルーティングしてしまうため、メインルータより先と通信することができなくなります。

一方、FortiGate にて link-monitor の設定をして 10.1.50.254 を通るルートの監視をしている場合、障害発生時は 10.1.60.254 (サブルータ) を通るルートに切り替えて通信することができます。

link-monitor の設定
link-monitor の設定は CLI でのみ実施可能です。
設定例として、以下の図の赤矢印のルートを監視対象とします。

設定コマンドの例は以下の通りです。
VLAN50 は 10.1.50.0/24 に属する FortiGate の VLAN インターフェースです。
config system link-monitor
edit "1"
set srcintf "VLAN50"
set server "192.168.179.1"
set interval 1
set failtime 1
set recoverytime 1
set update-cascade-interface disable
next
end
設定項目としては以下があります。
FW01 (link-monitor) # edit 1
FW01 (1) #
FW01 (1) # set
addr-mode Address mode (IPv4 or IPv6).
srcintf Interface that receives the traffic to be monitored.
*server IP address of the server(s) to be monitored.
protocol Protocols used to monitor the server.
gateway-ip Gateway IP address used to probe the server.
source-ip Source IP address used in packet to the server.
interval Detection interval (1 - 3600 sec, default = 5).
failtime Number of retry attempts before the server is considered down (1 - 10, default = 5)
recoverytime Number of successful responses received before server is considered recovered (1 - 10, default = 5).
ha-priority HA election priority (1 - 50).
update-cascade-interface Enable/disable update cascade interface.
update-static-route Enable/disable updating the static route.
status Enable/disable this link monitor.
FW01 (1) #
項目:srcintf
で監視するルートへデータ送信する際に使用する FortiGate のインターフェースを指定します。
項目:server
で監視先のIPアドレスを指定します。監視したいルートの終端となる IP アドレスを指定します。
この 2 つは設定必須の項目です。
config system link-monitor
edit "1"
set srcintf "VLAN50"
set server "192.168.179.1"
next
end
項目:interval
でpingを何秒間隔で飛ばすかを設定します。デフォルトは5秒です。
項目:failtime
で何度 ping に失敗したらルートを切り替えるのかを設定します。デフォルトは 5 です。
項目:recoveryrtime
で監視対象の IP アドレスから何度 ping 応答があったら復旧したと判定するのかを指定します。デフォルトは 5 です。
config system link-monitor
edit "1"
set interval 1
set failtime 1
set recoverytime 1
next
end
項目:update-cascade-interface
については、監視対象IPアドレスと疎通が取れなくなった場合に、srcintf として指定したインターフェイスをダウンさせるかどうかです。
デフォルトでは enable ですが、ダウンさせたくない場合は disable とします。
config system link-monitor
edit "1"
set update-cascade-interface disable
next
end
ちなみに設定例での edit 1 のフルコンフィグは以下の通りです。
FW01 (1) # show full-configuration
config system link-monitor
edit "1"
set addr-mode ipv4
set srcintf "VLAN50"
set server "192.168.179.1"
set protocol ping
set gateway-ip 0.0.0.0
set source-ip 0.0.0.0
set interval 1
set failtime 1
set recoverytime 1
set ha-priority 1
set update-cascade-interface disable
set update-static-route enable
set status enable
next
end
項目:update-static-route
についてはデフォルトで enable ですが、これを disable にすると疎通不可となったルートがルーティングテーブルから削除されない(ルートが切り替わらない)ので注意してください。
link-monitor の検証
まず正常時のルートを確認します。
FW01 # get router info routing-table all
Routing table for VRF=0
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
S* 0.0.0.0/0 [10/0] via 10.1.50.254, VLAN50 ←★
C 10.1.10.0/24 is directly connected, VLAN10
C 10.1.20.0/24 is directly connected, VLAN20
C 10.1.30.0/24 is directly connected, VLAN30
C 10.1.40.0/24 is directly connected, VLAN40
C 10.1.50.0/24 is directly connected, VLAN50
C 10.1.60.0/24 is directly connected, VLAN60
10.1.50.254 を通るルートがデフォルトルートになっています。
またクライアントから 192.168.179.1 へのトレースルートの結果は以下の通りです。
C:\Users\testuser>tracert 192.168.179.1
192.168.179.1 へのルートをトレースしています。経由するホップ数は最大 30 です
1 3 ms 2 ms 1 ms 10.1.10.1
2 2 ms 2 ms 3 ms 10.1.50.254
3 7 ms 4 ms 4 ms 192.168.179.1
トレースを完了しました。
では以下の図の通りメインルータの無線 AP 側のケーブルを抜線してみます。

抜線前後のクライアントから 192.168.179.1 (WiMax) への ping の結果は以下の通りです。

ルートの切り替わり時間は 3 秒くらいでした。
※切り替わり時間は link-monitor の設定状況によって変わります
抜線後のルートを確認します。
FW01 # get router info routing-table all
Routing table for VRF=0
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
S* 0.0.0.0/0 [20/0] via 10.1.60.254, VLAN60 ←★
C 10.1.10.0/24 is directly connected, VLAN10
C 10.1.20.0/24 is directly connected, VLAN20
C 10.1.30.0/24 is directly connected, VLAN30
C 10.1.40.0/24 is directly connected, VLAN40
C 10.1.50.0/24 is directly connected, VLAN50
C 10.1.60.0/24 is directly connected, VLAN60
10.1.60.254(サブルータ)を通るルートがデフォルトルートに変わっていることが分かります。 またクライアントから 192.168.179.1 へのトレースルートの結果は以下の通りです。
C:\Users\testuser>tracert 192.168.179.1
192.168.179.1 へのルートをトレースしています。経由するホップ数は最大 30 です
1 6 ms 2 ms 1 ms 10.1.10.1
2 3 ms 2 ms 2 ms 10.1.60.254
3 5 ms 4 ms 4 ms 192.168.179.1
トレースを完了しました。
10.1.60.254 を通るルートに変わったことが確認できました。

link-monitor のステータス確認コマンド
diagnose sys link-monitor status all
■モニタ対象と正常に疎通が取れる場合
FW01 # diagnose sys link-monitor status all
Link Monitor: 1, Status: alive, Server num(1), Create time: Sat Dec 28 08:52:08 2019
Source interface: VLAN50 (23)
Interval: 1
Peer: 192.168.179.1(192.168.179.1)
Source IP(10.1.50.1)
Route: 10.1.50.1->192.168.179.1/32, gwy(10.1.50.254)
protocol: ping, state: alive
Latency(Min/Max/Avg): 1.971/28.514/3.938 ms
Jitter(Min/Max/Avg): 0.002/23.504/2.436
Packet lost: 0.000%
Number of out-of-sequence packets: 2081298
Fail Times(0/1)
Packet sent: 3265569, received: 2146619, Sequence(sent/rcvd/exp): 54306/54306/65536
出力の 1 行目に Status: alive
と出力されています。
■モニタ対象と疎通が取れない場合
FW01 # diagnose sys link-monitor status all
Link Monitor: 1, Status: die, Server num(1), Create time: Sat Dec 28 08:52:08 2019
Source interface: VLAN50 (23)
Interval: 1
Peer: 192.168.179.1(192.168.179.1)
Source IP(10.1.50.1)
Route: 10.1.50.1->192.168.179.1/32, gwy(10.1.50.254)
protocol: ping, state: die
Packet lost: 23.333%
Number of out-of-sequence packets: 2081692
Recovery times(0/1) Fail Times(1/1)
Packet sent: 3265972, received: 2147013, Sequence(sent/rcvd/exp): 54709/54701/65536
出力の 1 行目に Status: die
と出力されています。
以上です。
―――――――――――――
次のステップ → FortiGate での PPPoE 設定手順
―――――――――――――