MultiWan (all NATed) and Port-Forwarding
shaoranrch last edited by
Currently I'm struggling with the following. I've got a setup where a PfSense machine's got multiple WAN connections. All these WANs IPs are learnt via DHCP. Also, in order for my hosts to use them I do NAT on each one together with gateway-groups, so far, so good.
Now I've added port-forwarding to each wan, on this case UDP 1194 on each WAN is being forwarded to 127.0.0.1 1194 (just like on this guide https://doc.pfsense.org/index.php/Multi-WAN_OpenVPN) - Problem is, it doesn't work as intended (the way I need it to work), here's what happens:
Consider that the default gateway for PfSense by the time is 22.214.171.124 on interface WAN01 (IP 126.96.36.199), now, OVPN traffic is getting in via interface WAN02(IP 188.8.131.52) since the client is trying to connect to it at the moment. The port-forwarding rules are doing what they're supposed to do, so it sends it to 127.0.0.1 and the OVPN daemon responds, now the problem is with this answer…
Since the default gateway is via WAN01, it'll use it, and since WAN01 is set to NAT all outgoing connections (just like all the WAN interfaces on this setup) I get to a situation where:
Traffic is directed to 184.108.40.206 via WAN02
Replies to said traffic are going out via WAN01 (instead of WAN02) and with a SRC-Address (thanks to NAT) of 220.127.116.11, so obviously the tunnel is never established until the client tries to connect directly to 18.104.22.168
Here's my question, how can I force that traffic arriving over each WAN interface, returns via the same interface it arrived? So on this case, traffic arrived via WAN02 to 22.214.171.124, it should leave via WAN02 (whether this is the default gateway by that time).