0

similar situation as this one: How to setup pfSense with multiple public IP's i have a pfsense with multiple wlan ip's. I'm using a Hetzner Server with vmware so i have a virtual machine with pfsense running in it. There are 3 WAN IP's with 3 WAN Interfaces on Pfsense (also 3 MAC-Adresses attached to these interfaces - i got the MAC from hetzner) and one default gateway configured on the first WAN1 ip.

The firewall is working fine, but with the settings above all outgoing traffic is outgoing only with the WAN 1 IP visible. Regardless the traffic is NAT'ed von WAN2 to inside 192.168.0.1. Outgoing Traffic always with WAN1 IP. This is bad because mailserver is on WAN3 IP and all outgoing mails will be send with IP of WAN1 Interface.

may someone can help me how to configure pfsense to NAT this also outside to the right interface. regards Michael

1 Answer 1

0

You can use the pf route-to clause to forward traffic via specific interface.

You can try something like that, considering ISP1 interface is vlan1 and it's the interface with default gateway:

isp1if = "vlan1" isp2if = "vlan2" isp1ip = "192.168.0.1" isp2ip = "192.168.1.1" isp2gateway = "192.168.10.1" nat on $isp1if proto tcp from $isp1ip to any port 25 -> $isp2if pass out on $isp1if route-to ($isp2if $isp2gateway) proto tcp from $isp1ip to any port 25

I'm not quite sure that this will work after copy/paste sequence, and possibly this will require one more nat rule for ISP2 interface (this can be determined only experimentally), but this is definitely a way to start.

Things would be easier with ipfw, because it's more flexible when it comes to NAT. Things would be even more easy with multiple routing tables, but, as I can see, pfSense does not support neither them, nor the building custom kernel way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .