The fortigate 5.x documentation states that when you create a virtual IP address (VIP)
and do NOT specify port mapping, that traffic should be translated for both inbound (dnat)
and outbound (snat) traffic.
If says: " if you leave the ' port forwarding' checkbox unchecked it is therefore mapping all
ports, it will do bi-directional NAting, so the single VIP entry will control both inbound
and outbound address translation."
Overall this seems like a very good thing for reducing the complexity of configuration
for standard internet-accessible servers.
However, we' re finding that this doesn' t seem to work unless you issue
" set nat-source-vip enable" from the CLI for every VIP (it defaults to disable).
By default, outbound traffic just falls through to the general nat pool that we have
set up for all other clients.
Is this the expected behavior? If so, I can' t see how the reference manual is correct.
If this is needed, is there a way to change the default for all VIP' s to nat-source-vip enable?
Otherwise it' s kind of a bummer to follow up each GUI based VIP with a cli command.
Here' s an example of what I see from debug in each case.
.163 is the shared pool setup for all clients, .184 is the VIP for this host. Note that
the system sees the VIP outbound IP in both cases but just seems to ignore it by
default.
Outbound initiated traffic with default settings:
id=20085 trace_id=2 func=resolve_ip_tuple_fast line=4310 msg=" vd-root received a packet(proto=6, 10.XX.XX.31:56200->64.XX.XX.216:80) from lan."
id=20085 trace_id=1 func=get_new_addr line=2593 msg=" find SNAT: IP-206.XX.XX.163(from IPPOOL), port-56199"
id=20085 trace_id=1 func=get_new_addr line=2593 msg=" find SNAT: IP-206.XX.XX.184(from IPPOOL), port-0(fixed port)"
id=20085 trace_id=1 func=__ip_session_run_tuple line=2471 msg=" SNAT 10.XX.XX.31->206.XX.XX.163:56199"
Here' s what I see after adding nat-source-vip enable:
id=20085 trace_id=173 func=resolve_ip_tuple_fast line=4310 msg=" vd-root received a packet(proto=6, 10.XX.XX.31:57646->64.XX.XX.216:80) from lan."
id=20085 trace_id=173 func=get_new_addr line=2593 msg=" find SNAT: IP-206.XX.XX.163(from IPPOOL), port-57646"
id=20085 trace_id=173 func=get_new_addr line=2593 msg=" find SNAT: IP-206.XX.XX.184(from IPPOOL), port-0(fixed port)"
id=20085 trace_id=173 func=__ip_session_run_tuple line=2471 msg=" SNAT 10.XX.XX.31->206.XX.XX.184:57646"