Technical Tip: NAT46 VIP with src-filter may still forward non-matching traffic to naf.traffic
| Description | In some NAT46 VIP deployments, traffic destined to the VIP external IPv4 address may still be routed to naf.traffic even when the source IP does not match the configured src-filter. As a result, non-matching traffic can fail forward policy lookup and be dropped by policy 0, instead of continuing through the normal IPv4 path. This differs from NAT44 behavior, where non-matching traffic can continue through the regular routing path without being redirected for protocol translation. |
| Scope | FortiOS 7.2.x, 7.4.x, 7.6.x with NAT46 VIP. |
| Solution | An example scenario is shown below:
VIP configuration:
Central SNAT:
Firewall policy:
Expected behavior:
Observed behavior:
For the non-matching source 10.10.10.219, the packet does not match DNAT, but it is still routed to naf.traffic and then dropped. The relevant debug flow output is shown below:
received a packet(proto=1, 10.10.10.219:30071->198.51.100.114:2048) from port2
For the matching source 10.10.10.218, the packet matches the NAT46 VIP and is forwarded successfully. Successful debug flow is shown below:
received a packet(proto=1, 10.10.10.218:28791->198.51.100.114:2048) from port2
Routing table behavior: Without a workaround, the FortiGate installs a route for the VIP external IP toward naf.traffic:
get router info routing-table all
Because of this, traffic destined to the VIP external IP may still be forwarded to naf.traffic even when the source does not match the VIP src-filter.
Explanation: For NAT46/NAT64, FortiGate uses naf.traffic to perform protocol translation and feed the packet back into the network stack with the new IP version. Because of this design, traffic to the VIP external IP may still be pulled into the NAT46 path even if the source address does not match the VIP src-filter. This is why the behavior does not match NAT44.
Workaround: A policy route can be used so traffic that should not use NAT46 is forced to the normal IPv4 path.
Example:
A scalable alternative is to negate the source that should use NAT46:
With the policy route workaround, the policy route takes precedence over the static route, so traffic is forwarded through the normal IPv4 path instead of being sent to naf.traffic.
Summary: In NAT46 VIP deployments, traffic that does not match the VIP src-filter may still be routed to naf.traffic based on the VIP external IP and then be dropped by policy 0. A validated workaround is to use a policy route so non-matching traffic bypasses the NAT46 path. |
