Hi , these days i am studing FGT, i am confused at this case-
The VIP is set extintf 'port10', but now 10.10.10.2 accesses 10.10.10.100 port 21, the packet is entering in port9, not in port10,can this activate the DNAT(VIP)?How the FGT works at this scene?
I searched many documents but no answer. Thank you in advance!
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Hi, Please refer the below KB
Thanks Patterson, but did not not answer my question yet. Why the traffic goes in port9 can activate the DNAT'ed(VIP)? Then the traffic goes to port9, why "Allowed by policy-2 SNAT"? I did not see any ’NAT enabled' at policy-2.
Hi,
In this scenario the traffic enters and leaves FortiGate via the same interface. This causes FortiOS to automatically perform SNAT, even if NAT is not configured in the firewall policy.
Below KB will provide you details and steps to disable SNAT if required.
I have tested this in Lab
session info: proto=1 proto_state=00 duration=2 expire=59 timeout=0 flags=00000000 socktype=0 sockport=0 av_idx=0 use=5
origin-shaper=
reply-shaper=
per_ip_shaper=
class_id=0 ha_id=0 policy_dir=0 tunnel=/ vlan_cos=0/255
state=may_dirty
statistic(bytes/packets/allow_err): org=180/3/1 reply=180/3/1 tuples=4
tx speed(Bps/kbps): 86/0 rx speed(Bps/kbps): 86/0
orgin->sink: org pre->post, reply pre->post dev=5->5/5->5 gwy=10.234.3.199/10.234.3.55
hook=pre dir=org act=dnat 10.234.3.55:1->1.1.1.1:8(10.234.3.199:8)
hook=post dir=org act=snat 10.234.3.55:8->10.234.3.199:8(10.234.3.24:60424)
hook=pre dir=reply act=dnat 10.234.3.199:60424->10.234.3.24:0(10.234.3.55:8)
hook=post dir=reply act=snat 10.234.3.199:8->10.234.3.55:0(1.1.1.1:1)
misc=0 policy_id=9 pol_uuid_idx=14741 auth_info=0 chk_client_info=0 vd=0
serial=0017d318 tos=ff/ff app_list=0 app=0 url_cat=0
rpdb_link_id=00000000 ngfwid=n/a
npu_state=0x000100
total session 1
I appreciate, Patterson! I see the difference from snat-hairpair-traffic enabled and disabled you showed me.
And my last question is : the VIP extintf was set 'port10', Why the traffic enters in 'port9' can activate the DNAT'ed(VIP)?
Hi georgeWong, VIP is like a global parameter and associating VIP with exintf will not restrict it from triggering.
Please refer this doc which explains about the VIP exintf on a scenario basis : https://community.fortinet.com/t5/FortiGate/Technical-Tip-Configuring-Hairpin-NAT-VIP/ta-p/195448
Got it, thanks Patterson. I reviewed the traffic working process:
Created on 03-26-2022 06:46 AM Edited on 03-26-2022 06:47 AM
Hi georgeWong, Please refer the below order. You can see policy lookup is done twice.
1, init_ip_session
2, iprope_dnat_check ->Trigger
3, iprope_fwd_check -> routing
4, iprope_check_one_policy -> policy
5, fw_pre_route_handler -> VIP DNAT
6, iprope_fwd_check -> routing
7, iprope_check_one_policy ->policy
8, fw_forward_handler -> Allow the traffic SNAT
Hi Patterson, in the scene , total two policies: policy-1 and policy-2. As your order above, Which policy matches at Step 4? And which policy matches at Step 7?
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1735 | |
1107 | |
752 | |
447 | |
240 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.