代理 ARP
2025/11/25网络管理7.X.X大约 3 分钟
代理 ARP
功能简介
代理 ARP(Proxy ARP)允许 FortiGate 代表其他 IP 地址响应 ARP 查询。当对端主机误认为某目标 IP 与其位于同一网段,但实际该 IP 位于 FortiGate 后方或其他网络时,代理 ARP 可确保 ARP 能正常解析,使流量正确转发至 FortiGate。
- FortiGate 将以自身 MAC 地址回应指定 IP 的 ARP Request。
- 不会改变三层路由,仅处理二层解析问题。
- 支持 IP 段(start-ip/end-ip)。
典型应用场景包括:
- 主机配置了错误的或更大的子网掩码导致跨网段访问失败。
- 公网地址无需配置为接口 Secondary IP,但仍需在接口上对外 ARP 响应(如 SNAT 使用“出接口地址”)。
- SD-WAN 或 ACME 不支持 Loopback 接口时,通过代理 ARP 实现公网 IP 的 ARP 响应。
- ISP 使用私网 Transit LAN 传递公网地址时,通过代理 ARP 让 CPE 学到下一跳 MAC。
配置方法
代理 ARP 在接口级别配置,可指定单个或多个 IP(连续地址段),用于在二层广播域内回应 ARP 请求。
config system proxy-arp
edit <id>
set interface {string} <----代理 ARP 生效的接口
set ip {ipv4-address} <----需要代理响应 ARP 的起始 IP,如果只有一个IP,只需要配置此项
set end-ip {ipv4-address} <----需要代理响应 ARP 的结束 IP,需要配置 IP 范围时配置此项
next
end网络拓扑

- PC2 的地址为
192.168.1.14/24(而非/29)。PC2 需要访问192.168.1.6/29(PC1) 时,由于使用/24掩码,它会认为 PC1 与其处于同一子网。 - 因此 PC2 会向本地网络广播 ARP 请求以解析
192.168.1.6的 MAC 地址。该广播会在 FortiGate 的接口(地址192.168.1.9/29)处终止。 - FortiGate 的该接口并不是
192.168.1.6。如果未在该接口上配置代理 ARP,FortiGate 将不会回应 PC2 的 ARP 请求,导致 PC2 无法访问 PC1。 - 启用代理 ARP 后,FortiGate 会使用自身的接口 MAC 地址回应 ARP,整个代理过程对 PC2 完全透明。
- PC2 将 192.168.1.6 的 MAC 解析为 FortiGate 的接口 MAC。
- PC2 把数据包交给 FortiGate。
- FortiGate 再将数据包转发至真正的目标 PC1。
配置步骤
基础网络配置(略)。
在 FortiGate 的 wan1 接口配置代理 ARP,代理响应请求 PC1 的 IP
192.168.100.6的 ARP 广播。config system proxy-arp edit 1 set interface "wan1" set ip 192.168.100.6 next end
结果验证
在 FortiGate 上查看代理 ARP 表项。
FortiGate # get sys proxy-arp == [ 1 ] id: 1 interface: wan1 ip: 192.168.100.6 end-ip: 0.0.0.0使用 PC2 Ping PC1,在 FortiGate 上抓包可以看到,PC2 首先直接向广播域发送 ARP 广播,请求 PC1 的 MAC 地址,FortiGate 的 wan1 接口代理响应了该 ARP 请求,并将自身 wan1 接口的 MAC 地址返回给 PC2。
FortiGate # diagnose sniffer packet any '(arp or icmp) and host 192.168.100.6' 4 interfaces=[any] filters=[(arp or icmp) and host 192.168.100.6] 4.780241 wan1 in arp who-has 192.168.100.6 tell 192.168.100.10 5.532962 wan1 out arp reply 192.168.100.6 is-at e0:23:ff:67:e3:9c 5.533027 wan1 in 192.168.100.10 -> 192.168.100.6: icmp: echo request 5.533068 lan out 192.168.100.10 -> 192.168.100.6: icmp: echo request 5.533415 lan in 192.168.100.6 -> 192.168.100.10: icmp: echo reply 5.533433 wan1 out 192.168.100.6 -> 192.168.100.10: icmp: echo reply FortiGate # diagnose netlink interface list wan1 | grep hw Qdisc=mq hw_addr=e0:23:ff:67:e3:9c broadcast_addr=ff:ff:ff:ff:ff:ff