How to do an inbound and outbound NAT at the same time ?
-
Hello
Can pfsense perform a DNAT and a SNAT at the same time ?
I am trying to replace an old firewall by a pfsense and theses few nat rules are annoying me.Here is an exemple of what i am trying to do :
Before translation :
Source Destination Port
server1 FW_WAN_interface 7474After translation :
Source Destination Port
FW_LAN_interface computer1 7474Thanks in advance for your help
-
@kujyh
You will have to add two rules, a port forwarding and an outbound NAT rule to achieve this. -
@viragomann Does pfsense read the inbound rule before the outbond rule when the traffic come from the WAN to the LAN ?
If so, do I have to adapt the second rule considering the traffic modified by the first rule ?
-
@kujyh
Yes. But not clear if this really matters here.Add a NAT port forwarding rule on WAN, if needed specify the sourece as server1, dest is WAN address, dest port 7474 and redirect target is computer1 and port 7474.
Then add an outbound NAT rule. You may have to switch to hybrid mode if it's still in automatic.
Interface = LAN, source is again server1, destination computer1, dest. port 7474, translation address = "interface address". -
@viragomann i will try that, thanks :)