Local-out 流量控制
Local-out 流量控制
Local-out 流量指的是源自 FortiGate 并发往外部目标地址的流量。这种流量可能来自 Syslog、FortiAnalyzer 日志记录、FortiGuard 服务、远程认证等。默认情况下,Local-out 流量根据当前路由表来查找用于流量的出接口。但有些情况下,查询路由表的结果可能是去往目标 IP 的路径有多个出接口负载,但只有其中一个接口可以正确的到达目标地址。这种情况下如果负载到了错误的出接口,那么业务就会出现问题。
很多类型的 Local-out 流量支持根据 SD-WAN 规则或手工指定的接口作为出接口。在手工指定出口接口时,也可以指定源 IP 地址。支持设置出接口的 Local-out 流量类型如下所示:
Security Fabric → 外部连接器(External Resources)中的终端/身份(Endpoint/Identity,可通过 CLI 配置)、威胁来源等(Threat Feeds,可通过 GUI 和 CLI 配置)。
日志中的 FortiAnalyzer 服务器、FortiAnalyzer Cloud 服务器、FortiGate Cloud 日志服务器、Syslog 服务器等。(可通过 GUI 和 CLI 配置)
系统 DNS 服务器、FortiGuard 服务器、FortiSandbox 服务器等。(可通过 GUI 和 CLI 配置)
LDAP 服务器、TACACS + 服务器、Radius 服务器等。(可通过 CLI 配置)
重要
如果 FortiGate 开启了多 VDOM 功能,以上内容中 1、2、3 需要在 Global 视图下配置,4 需要在 VDOM 视图下配置。
Local-out 流量配置
通过 GUI 配置
DNS 流量
用户 FortiGate 设备路由表中有两条等价的默认路由,出接口分别为 wan1 和 wan2,只有 wan1 可以正常到达 DNS 服务器,DNS 流量默认情况下在 wan1 和 wan2 上负载,当负载到 wan2 时,DNS 解析会失败。
FortiGate # get router info routing-table static
Routing table for VRF=0
S* 0.0.0.0/0 [10/0] via 172.22.5.1, wan2, [1/0]
[10/0] via 172.22.6.1, wan1, [1/0]
...在 GUI 上配置 Local-out 流量控制,首先要在“系统管理 → 可见功能”中开启“本地出向流量路由”。

config system global set gui-local-out enable end进入网络 → 本地出向路由页面,编辑系统 DNS 选项。

配置系统 DNS 的流出接口为指定模式,并选择 wan1 作为出接口(如果 wan1 上有多个 IP,也可以修改源地址),点击确认下发配置。


config system dns set interface-select-method specify set interface "wan1" end
LDAP 流量
用户 FortiGate 设备路由表中有两条去往 LDAP 服务器所在网段的路由,出接口分别为 internal4 和 internal5,只有 internal5 可以正常到达 LDAP 服务器,LDAP 流量默认情况下在 internal4 和 internal5 上负载,当负载到 internal4 时,LDAP 会无法访问。
FortiGate # get router info routing-table static
S 192.168.100.0/24 [10/0] via 10.10.12.2, internal4, [1/0]
[10/0] via 10.10.13.2, internal5, [1/0]
...同时,LDAP 服务器只允许 FortiGate 以 10.10.12.111 作为源 IP 访问。
进入网络 → 本地出向路由页面,编辑系统 LDAP 服务器选项(只有配置了 LDAP/Radius/Tacacs + 服务器后,才会在这里显示)。

配置系统 LDAP 服务器的流出接口为指定模式,并选择 internal5 作为出接口,选择源 IP 为手动模式,选择 internal5 接口的第二地址 10.10.12.111,点击确认下发配置。


config user ldap edit "LDAP_Server1" set source-ip "10.10.12.111" set interface-select-method specify set interface "internal5" next end
通过 CLI 配置
PING & Traceroute
ping 和 traceroute 命令除了可以指定接口和源地址,也可以指定是否使用 SD-WAN 规则发送。
execute ping-options use-sdwan {yes | no}
execute ping6-options use-sd-wan {yes | no}
execute traceroute-options use-sdwan {yes | no}集中管理
连接 FortiManager 进行集中管理的流量。
config system central-management
set interface-select-method {auto | sdwan | specify}
set interface <interface>
endNTP 服务器
config system ntp
config ntpserver
edit <id>
set interface-select-method {auto | sdwan | specify}
set interface <interface>
next
end
endauto:查找路由表进行转发。sdwan:查找 SD-WAN 规则或策略路由进行转发。specify:手工指定接口转发。interface:interface-select-method配置为specify时可用,用于手工指定流量的出接口。
DHCP 代理
config system settings
set dhcp-proxy-interface-select-method {auto | sdwan | specify}
set dhcp-proxy-interface <interface>
endDHCP 中继
config system interface
edit <interface>
set dhcp-relay-interface-select-method {auto | sdwan | specify}
set dhcp-relay-interface <interface>
next
end证书 SCEP
config vpn certificate setting
set interface-select-method {auto | sdwan | specify}
set interface <interface>
set source-ip <IP address>
endIPS TLS 协议探测
config ips global
config tls-active-probe
set interface-selection-method {auto | sdwan | specify}
set interface <interface>
set vdom <VDOM>
set source-ip <IPv4 address>
set source-ip6 <IPv6 address>
end
endVDOM:当interface-selection-method设置为sdwan或specify时,可以指定流量的 VDOM。
NetFlow/sFlow
NetFlow:
config system {netflow | vdom-netflow}
set interface-select-method {auto | sdwan | specify}
set interface <interface>
set source-ip <IP address>
end
sFlow:
config system {sflow | vdom-sflow}
config collectors
edit <id>
set interface-select-method {auto | sdwan | specify}
set interface <interface>
set source-ip <IP address>
next
end
endFortiClient EMS
config endpoint-control fctems
edit fctems1
set interface-select-method {auto | sdwan | specify}
set interface <interface>
set source-ip <IP address>
end
endTACACS+
config log tacacs+accounting setting
set interface-select-method {auto | sdwan | specify}
set interface <interface>
set source-ip <IP address>
end