健康检查配置实践
健康检查配置实践
概述
在 SD-WAN 的健康检查中,探测目标可以配置 1 个 Server 或 2 个 Server,本文主要探讨:
- 健康检查探测目标个数/检测状态(up/down)对健康检查状态(alive/dead)的影响。
- 目标服务器数量对 Manual 模式的 SD-WAN 规则选路产生的影响。
- 健康检查选项中的“更新静态路由”(
update-static-route)对 SD-WAN 选路的作用,以及与探测目标服务器数量相关的差异化表现。 - 针对不同应用场景,提供相应的配置建议。
网络拓扑

FortiGate 有两条 ISP 线路(IPv4/IPv6 双栈)连接 Internet,两条 ISP 线路做双栈 SD-WAN。
FortiGate 配置健康检查,检查 Internet 上目标服务器(IPv4/IPv6)的状态,以健康检查的结果决定 SD-WAN 选路。
PC 通过 FortiGate 的 SD-WAN 选路来访问 Internet。
基础网络配置略,SD-WAN 基础配置与初始路由表,路由表中默认路由在两个 ISP 接口上负载:
config system sdwan set status enable config zone edit "virtual-wan-link" next end config members edit 1 set interface "port2" set gateway 202.103.12.1 set gateway6 2100::1 next edit 2 set interface "port3" set gateway 202.103.23.1 set gateway6 2200::1 next end end config router static edit 1 set distance 1 set sdwan-zone "virtual-wan-link" next end config router static6 edit 1 set distance 1 set sdwan-zone "virtual-wan-link" next end FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3 FortiGate # get router info6 routing-table Routing table for VRF=0 S* ::/0 [1/0] via 2100::1, port2, 17:24:49, [1024/0] [1/0] via 2200::1, port3, 17:24:49, [1024/0] C ::1/128 via ::, root, 3d18h28m C 2100::/64 via ::, port2, 17:25:23 C 2200::/64 via ::, port3, 17:25:13 C 2300::/64 via ::, port4, 00:00:04
1 个健康检查配置 2 个 Server
基础配置
在 FortiGate 上创建健康检查,配置 2 个 IPv4 探测 Server,检测 223.5.5.5(在前)和 223.6.6.6(在后),参与接口选择所有 SD-WAN 成员(port2 和 port3),默认开启
update-static-route。config health-check edit "Server" set server "223.5.5.5" "223.6.6.6" set members 0 next end查看健康检查的状态,两条线路均为 alive 状态。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(alive), packet-loss(0.000%) latency(15.662), jitter(11.245), mos(4.385), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(15.519), jitter(11.240), mos(4.385), bandwidth-up(9999998), bandwidth-dw(9999998), bandwidth-bi(19999996) sla_map=0x0配置 Manual 模式的 SD-WAN 规则,将 PC 网段的流量优先通过 ISP1(port2)线路进行转发,其次通过 ISP2(port3)线路进行转发。
config system sdwan config service edit 1 set name "to_Internet" set dst "all" set src "all" set priority-members 1 2 next end end查看 SD-WAN 规则选路状态,优先选择 ISP1(port2)线路转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(1), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(1 port2), alive, selected 2: Seq_num(2 port3), alive, selected Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255抓取探测报文可以看到,ISP1(port2)和 ISP2(port3)接口会同时探测 223.5.5.5 和 223.6.6.6 两个 Server。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.386576 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.386658 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.386675 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.386698 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.392926 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.393021 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply 0.393048 port2 in 223.5.5.5 -> 202.103.12.2: icmp: echo reply 0.393075 port2 in 223.6.6.6 -> 202.103.12.2: icmp: echo reply重要
后续本文使用如下简写来表示每个线路上对两个 Server 的探测结果:
ISP1#1:ISP1 上对 223.5.5.5 的探测结果。ISP1#2:ISP1 上对 223.6.6.6 的探测结果。ISP2#1:ISP2 上对 223.5.5.5 的探测结果。ISP2#2:ISP2 上对 223.6.6.6 的探测结果。
ISP1#1 down,其他 up
在 ISP1 上模拟探测的目标服务器 223.5.5.5(位于健康检查的 Server 序列 1)失效,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.316221 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.316311 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.316327 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.316354 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.322336 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.322364 port2 in 223.6.6.6 -> 202.103.12.2: icmp: echo reply 0.322412 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply此时查看健康检查状态,显示 ISP1 的状态变为 dead。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(7.209), jitter(2.282), mos(4.399), bandwidth-up(9999998), bandwidth-dw(9999998), bandwidth-bi(19999996) sla_map=0x0查看 FortiGate 的 SD-WAN 规则选路状态,选择 ISP2 线路(port3)进行转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(2), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(2 port3), alive, selected 2: Seq_num(1 port2), dead Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255查看路由表更新状态,port2 的默认路由仍然存在于路由表中,没有被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3
ISP1#2 down,其他 up
将所有 ISP 故障恢复。在 ISP1 上模拟 223.6.6.6(位于健康检查的 Server 序列 2)故障,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.228094 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.228174 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.228194 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.228218 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.234403 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.234449 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply 0.234472 port2 in 223.5.5.5 -> 202.103.12.2: icmp: echo reply此时查看健康检查状态,显示 ISP1 的状态变为仍为 alive。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(alive), packet-loss(0.000%) latency(6.296), jitter(0.547), mos(4.401), bandwidth-up(9999998), bandwidth-dw(9999999), bandwidth-bi(19999997) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(6.159), jitter(0.528), mos(4.401), bandwidth-up(9999998), bandwidth-dw(9999998), bandwidth-bi(19999996) sla_map=0x0查看 FortiGate 的 SD-WAN 规则选路状态,仍然选择 ISP1 线路(port2)进行转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(5), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(1 port2), alive, selected 2: Seq_num(2 port3), alive, selected Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255查看路由表更新状态,port2 的默认路由仍然存在于路由表中,没有被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3重要
健康检查状态对 Manual 模式 SD-WAN 规则的影响(1 个健康检查引用接口):
- 只要健康检查在这个接口上为 alive 状态,该线路就会被认为 alive,SD-WAN 规则不会切换下一个成员接口转发。
- 只要健康检查在这个接口上变为 dead 状态,该线路就会被认为 dead,SD-WAN 规则切换下一个 alive 成员接口转发。
ISP1#1 & ISP2#1 down,其他 up
将所有 ISP 故障恢复。在 ISP1 和 ISP2 上同时模拟 223.5.5.5(位于健康检查的 Server 序列 1)故障,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.386576 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.386658 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.386675 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.386698 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.393021 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply 0.393075 port2 in 223.6.6.6 -> 202.103.12.2: icmp: echo reply此时查看健康检查状态,显示 ISP1 和 ISP2 的状态均为 alive。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(alive), packet-loss(0.000%) latency(7.390), jitter(1.991), mos(4.399), bandwidth-up(9999998), bandwidth-dw(9999999), bandwidth-bi(19999997) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(7.218), jitter(1.961), mos(4.399), bandwidth-up(9999998), bandwidth-dw(9999999), bandwidth-bi(19999997) sla_map=0x0查看 FortiGate 的 SD-WAN 规则选路状态,仍然选择 ISP1 线路(port2)进行转发。

查看路由表更新状态,port2 的默认路由仍然存在于路由表中,没有被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3重要
2 个 Server 与健康检查状态的关系:健康检查在每条线路上的状态只由 1 个 Server 的探测结果决定。
-优先使用 #1 的探测结果:只要 #1 在任何一条线路上为 up,就忽略 #2 的探测结果(例如,#1 在 ISP1 为 down,但在 ISP2 为 up,此时 FortiGate 会判断这是线路问题,而不是 #1 服务器宕机,所以仍然采纳 #1 的探测结果,不会采纳 #2 的探测结果)。 -当 #1 在所有线路上为 down 时:健康检查才会采纳 #2 的探测结果(此时 FortiGate 认定 #1 服务器已经宕机,并开始采纳 #2 的探测结果)。
ISP1#1 & ISP1#2 down,其他 up
将所有 ISP 故障恢复。在 ISP1 上模拟 223.5.5.5 和 223.6.6.6 同时故障(ISP2 上 223.5.5.5 和 223.6.6.6 都可以访问),其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.382564 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.382643 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.382669 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.382692 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.388660 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.388690 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply此时查看健康检查状态,显示 ISP1(port2)的状态变为 dead。

查看 FortiGate 的 SD-WAN 规则选路状态,选择 ISP2 线路(port3)进行转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(6), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(2 port3), alive, selected 2: Seq_num(1 port2), dead Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255查看路由表更新状态,port2 的默认路由被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3
2 个健康检查引用相同接口(IPv4)
基础配置
恢复所有的 ISP 故障模拟。新建 1 个健康检查“Server_2”,探测 Server 为 60.247.121.226,同时引用 ISP1 线路接口(port2)和 ISP2 线路接口(port3)。
config system sdwan config health-check edit "Server" set server "223.5.5.5" "223.6.6.6" set members 0 next edit "Server_2" set server "60.247.121.226" set members 0 next end end查看健康检查的状态,两个健康检查在所有 ISP 上均为 alive 状态。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(alive), packet-loss(0.000%) latency(7.180), jitter(3.035), mos(4.398), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(7.134), jitter(3.012), mos(4.398), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Health Check(Server_2): Seq(1 port2): state(alive), packet-loss(0.000%) latency(2.530), jitter(0.208), mos(4.403), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(2.419), jitter(0.215), mos(4.403), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0重要
后续本文使用如下简写来表示每个线路上对两个 Server 的探测结果:
ISP1#1:健康检查“” Server“ ISP1 上对 223.5.5.5 的探测结果。ISP1#2:健康检查“” Server“ ISP1 上对 223.6.6.6 的探测结果。ISP2#1:健康检查“” Server“ ISP2 上对 223.5.5.5 的探测结果。ISP2#2:健康检查“” Server“ ISP2 上对 223.6.6.6 的探测结果。ISP1#Server_2:健康检查“” Server_2“ ISP1 上对 60.247.121.226 的探测结果。ISP2#Server_2:健康检查“” Server_2“ ISP2 上对 60.247.121.226 的探测结果。
ISP1#1 down,其他 up
在 ISP1 上模拟探测的目标服务器 223.5.5.5(位于健康检查“Server”的序列 1)失效,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.156992 port2 out 202.103.12.2 -> 60.247.121.226: icmp: echo request 0.157072 port3 out 202.103.23.2 -> 60.247.121.226: icmp: echo request 0.157106 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.157127 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.157196 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.157220 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.159406 port2 in 60.247.121.226 -> 202.103.12.2: icmp: echo reply 0.159485 port3 in 60.247.121.226 -> 202.103.23.2: icmp: echo reply 0.162822 port2 in 223.6.6.6 -> 202.103.12.2: icmp: echo reply 0.162899 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.162916 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply此时查看健康检查状态,健康检查“Server”中的 ISP1 线路变为 dead 状态,健康检查“Server_2”中的 ISP1 线路仍为 alive 状态。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(9.357), jitter(4.683), mos(4.395), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Health Check(Server_2): Seq(1 port2): state(alive), packet-loss(0.000%) latency(2.509), jitter(0.169), mos(4.403), bandwidth-up(9999996), bandwidth-dw(9999996), bandwidth-bi(19999992) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(2.403), jitter(0.152), mos(4.403), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0查看 SD-WAN 规则选路状态,仍然优先选择 ISP1(port2)线路转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(2), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(1 port2), alive, selected 2: Seq_num(2 port3), alive, selected Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255查看路由表更新状态,port2 的默认路由仍然存在于路由表中,没有被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3
ISP1#1 & ISP1#Server_2 down,其他 up
将所有 ISP 故障恢复。在 ISP1 线路(port2)上模拟探测的目标服务器 223.5.5.5(位于健康检查“Server”的序列 1)和 60.247.121.226(位于健康检查“Server_2”)失效,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.424523 port2 out 202.103.12.2 -> 60.247.121.226: icmp: echo request 0.424724 port3 out 202.103.23.2 -> 60.247.121.226: icmp: echo request 0.425029 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.425091 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.425162 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.425210 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.427347 port3 in 60.247.121.226 -> 202.103.23.2: icmp: echo reply 0.430943 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.430983 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply 0.431002 port2 in 223.6.6.6 -> 202.103.12.2: icmp: echo reply此时查看健康检查状态,健康检查“Server_2”中的 ISP1 线路变为 dead 状态。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(7.006), jitter(2.388), mos(4.398), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0 Health Check(Server_2): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(2.331), jitter(0.189), mos(4.403), bandwidth-up(9999997), bandwidth-dw(9999997), bandwidth-bi(19999994) sla_map=0x0查看 SD-WAN 规则选路状态,变为优先选择 ISP2(port3)线路转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(5), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(2 port3), alive, selected 2: Seq_num(1 port2), dead Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255重要
健康检查状态对 Manual 模式 SD-WAN 规则的影响(多个健康检查引用接口):
当配置多个健康检查引用了同一个接口时,需要所有引用此接口的健康检查同时变为 dead 状态,该线路才会被认为 dead,SD-WAN 规则选择从下一个 alive 成员接口转发。
查看路由表更新状态,port2 的默认路由仍然存在于路由表中,没有被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.12.1, port2, [1/0] [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3
ISP1#1 & ISP1#2 & ISP1#Server_2 down,其他 up
将所有 ISP 故障恢复。在 ISP1 线路(port2)上模拟探测的目标服务器 223.5.5.5(位于健康检查“Server”的序列 1)、223.6.6.6(位于健康检查“Server”的序列 2)和 60.247.121.226(位于健康检查“Server_2”)失效,其他正常访问。
FortiGate # diagnose sniffer packet any icmp 4 Using Original Sniffing Mode interfaces=[any] filters=[icmp] 0.534318 port2 out 202.103.12.2 -> 223.5.5.5: icmp: echo request 0.534508 port2 out 202.103.12.2 -> 223.6.6.6: icmp: echo request 0.534587 port3 out 202.103.23.2 -> 223.5.5.5: icmp: echo request 0.534648 port3 out 202.103.23.2 -> 223.6.6.6: icmp: echo request 0.534686 port2 out 202.103.12.2 -> 60.247.121.226: icmp: echo request 0.534748 port3 out 202.103.23.2 -> 60.247.121.226: icmp: echo request 0.536783 port3 in 60.247.121.226 -> 202.103.23.2: icmp: echo reply 0.540581 port3 in 223.5.5.5 -> 202.103.23.2: icmp: echo reply 0.540609 port3 in 223.6.6.6 -> 202.103.23.2: icmp: echo reply查看路由表更新状态,port2 的默认路由被删除。
FortiGate # get router info routing-table all Routing table for VRF=0 S* 0.0.0.0/0 [1/0] via 202.103.23.1, port3, [1/0] C 10.10.1.0/24 is directly connected, port4 C 202.103.12.0/24 is directly connected, port2 C 202.103.23.0/24 is directly connected, port3重要
多个健康检查与更新静态路由的关系:
- 只有当接口关联的所有健康检查中的探测服务器都处于 down 状态时,相关接口上的路由才会被删除。
- 即使接口关联的所有健康检查显示为 dead 状态,但只要有一个健康检查中的服务器为 up(例如:#1 为 down,#2 为 up),就不会触发更新静态路由(
update-static-route)的动作。
2 个健康检查引用相同接口(IPv4 + IPv6)
在以上配置和故障模拟的基础上,新建健康检查“Server_3”的探测目标为 IPv6 地址。
config system sdwan config health-check edit "Server" set server "223.5.5.5" "223.6.6.6" set members 0 next edit "Server_2" set server "60.247.121.226" set members 0 next edit "Server_3" set addr-mode ipv6 set server "::223:5:5:5" set members 0 next end end查看健康检查的状态,IPv4 健康检查在 ISP1 线路(port2)上均为 dead 状态,IPv6 健康检查在 ISP2 线路(port3)上为 alive 状态。

FortiGate # diagnose sys sdwan health-check status Health Check(Server): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(2.000%) latency(5.965), jitter(0.724), mos(4.400), bandwidth-up(9999996), bandwidth-dw(9999996), bandwidth-bi(19999992) sla_map=0x0 Health Check(Server_2): Seq(1 port2): state(dead), packet-loss(100.000%) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(2.000%) latency(2.414), jitter(0.160), mos(4.402), bandwidth-up(9999996), bandwidth-dw(9999996), bandwidth-bi(19999992) sla_map=0x0 Health Check(Server_3): Seq(1 port2): state(alive), packet-loss(0.000%) latency(2.351), jitter(0.188), mos(4.403), bandwidth-up(9999996), bandwidth-dw(9999998), bandwidth-bi(19999994) sla_map=0x0 Seq(2 port3): state(alive), packet-loss(0.000%) latency(2.281), jitter(0.224), mos(4.403), bandwidth-up(9999996), bandwidth-dw(9999996), bandwidth-bi(19999992) sla_map=0x0查看 SD-WAN 规则(IPv4)选路状态,变为优先选择 ISP1(port2)线路转发。

FortiGate # diagnose sys sdwan service Service(1): Address Mode(IPV4) flags=0x200 use-shortcut-sla Tie break: cfg Gen(2), TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members(2): 1: Seq_num(1 port2), alive, selected 2: Seq_num(2 port3), alive, selected Src address(1): 0.0.0.0-255.255.255.255 Dst address(1): 0.0.0.0-255.255.255.255重要
健康检查状态对 Manual 模式 SD-WAN 规则的影响(多个 IPv4/IPv6 健康检查同时引用接口):
引用同一接口的健康检查探测目标 Server 有 IPv4、IPv6 两种,必须满足所有接口相关的健康检查为 dead 状态时,该线路才会被认为 dead,Manual 模式的 SD-WAN 规则(无论是 IPv4 规则还是 IPv6 规则)才会选择从下一个 alive 成员接口转发。
总结
健康检查目标个数对健康检查状态的影响
- 1 个目标服务器:如果健康检查配置只有 1 个探测 Server,则健康检查状态直接由该目标的状态决定。探测目标 down 时,健康检查被标记为 dead。
- 2 个目标服务器:健康检查在每条线路上的状态只由 1 个 Server 的探测结果决定。 -优先使用 #1 的探测结果:只要 #1 在任何一条线路上为 up,就忽略 #2 的探测结果(例如,#1 在 ISP1 为 down,但在 ISP2 为 up,此时 FortiGate 会判断这是线路问题,而不是 #1 服务器宕机,所以仍然采纳 #1 的探测结果,不会采纳 #2 的探测结果)。 -当 #1 在所有线路上为 down 时:健康检查才会采纳 #2 的探测结果(此时 FortiGate 认定 #1 服务器已经宕机,并开始采纳 #2 的探测结果)。
健康检查状态对 Manual 模式 SD-WAN 规则选路的影响
1 个健康检查引用接口:
- 只要健康检查在这个接口上为 alive 状态,该线路就会被认为 alive,SD-WAN 规则不会切换下一个成员接口转发。
- 只要健康检查在这个接口上变为 dead 状态,该线路就会被认为 dead,SD-WAN 规则切换下一个 alive 成员接口转发(即使健康检查关闭了
update-static-route),如果 SD-WAN 规则的所有成员都变为 dead 状态,则该条 SD-WAN 规则会被跳过匹配(即使健康检查关闭了update-static-route)。
多个健康检查引用接口:
重要
Best quality、Lowest cost (SLA)、Maximize bandwidth (SLA) 模式的 SD-WAN 必须选择一个具体的健康检查,不需要考虑下列情况。
- 当配置多个健康检查引用了同一个接口时,需要所有引用此接口的健康检查同时变为 dead 状态,该线路才会被认为 dead,SD-WAN 规则选择从下一个 alive 成员接口转发。
- 引用同一接口的健康检查探测目标 Server 有 IPv4、IPv6 两种,必须满足所有接口相关的健康检查为 dead 状态时,该线路才会被认为 dead,SD-WAN 规则(无论是 IPv4 规则还是 IPv6 规则)才会选择从下一个 alive 成员接口转发。
多个健康检查与更新静态路由的关系
- 只有当接口关联的所有健康检查中的探测服务器都处于 down 状态时,相关接口上的路由才会被删除。
- 即使接口关联的所有健康检查显示为 dead 状态,但只要有一个健康检查中的服务器为 up(例如:#1 为 down,#2 为 up),就不会触发更新静态路由(
update-static-route)的动作。
配置建议
健康检查的探测目标
- 优选稳定、低延迟、高可靠性的探测目标(如公共 DNS 服务器)。
- 在高可用需求场景中,可以在健康检查中配置 2 个目标服务器并合理设置先后顺序。
- 确保接口关联的健康检查数量和目标足够精准,避免冗余,尽量不要使用多个健康检查引用同一个接口。
更新静态路由
在配置健康检查时,是否开启update-static-route功能取决于具体的网络环境和需求。以下是关于何时应开启/关闭此功能的建议:
- 建议关闭
update-static-route的情况: -**仅作为测试的健康检查:**即使没有 SD-WAN 规则引用,update-static-route仍会生效,开启该功能可能导致网络中断。因此,对于任何非生产性的测试配置,请关闭update-static-route选项。 -**单一探测目标:**在健康检查仅配置了 1 个探测服务器,并且 FortiGate 设备自身需要发起流量(例如 IPSec、SSL VPN 或 BGP 通信)的情况下,启用update-static-route可能导致相关流量路径变化,进而引起服务中断。 - 可以考虑开启
update-static-route的情况: -**多 Server 健康检查:**健康检查配置多个 Server 时,可以根据实际情况考虑开启更新静态路由(update-static-route)。 -**IPv4/IPv6 共存:**对于同时支持 IPv4 和 IPv6 的网络环境,为 IPv4/IPv6 分别配置了健康检查目标。