Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved NAT
    3 Posts 2 Posters 570 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      ivo.lauro
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        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.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 1
        • I
          ivo.lauro
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.