Port forwarding to an host that have a gateway different than pfSense



  • Hello,

    I have a VM published on Internet with ip 1.2.3.4 and gateway 2.3.4.5, called Services

    I have created another VM with pfSense and public IP 1.2.3.5 with gateway 2.3.4.5

    I created a local network 192.168.1.0/24 where the Services has address 192.168.1.10 and pfSense 192.168.1.1

    In the pfSense I configured the port forwarding to Services and it doesn't work because the connection arrive to Services with the client IP as source IP, so it responses to the default gateway (2.3.4.5) instead to reply back to pfSense (192.168.1.1).

    Is there a way to let the connection arrive to the Services with the pfSense local IP as the source?

    Thanks a lot,
    Ivo


  • Rebel Alliance Developer Netgate

    You can switch to hybrid or manual outbound NAT and setup a rule to translate the source for traffic going to the server. Then it will appear to originate from the pfSense firewall.

    Alternately, to do it without NAT, depending on the service you might be able to use HAProxy to handle the connections.



  • Hello jimp,

    thank you very much, the new rule works.
    I'll never thought of using outbound rules to change inbound port forwarding.

    All the best,
    Ivo


Log in to reply