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

    One External IP address on Same Interface for HAProxy and Nat?

    Scheduled Pinned Locked Moved Official Netgate® Hardware
    2 Posts 2 Posters 563 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.
    • C
      chrisathome
      last edited by

      I'm setting up a 3 virtual machine environment for website hosting purposes on esxi behind pfsense on a Netgate 2100.

      We have 2 external IP addresses from the ISP.

      Can we use the same interface and same external IP for both HAProxy and NAT
      In PFSENSE?

      Currently this is the setup:
      VM 1: External static IP 1 NATs to VM1 no problem.

      VM 2: External static IP 2 NATs to VM 2 no problem.

      Trying with VM3: with same External static IP 2 via HAProxy to VM3. The problem is it redirects to the website on VM1.

      TIA

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        You can't if they are all using port 443 (or 80).
        You can either redirect port 443 to the internal IP or allow HAProxy to accept that connection on the firewall but not both.
        However that's exactly what HAProxy is for. It can accept all the connections on port 443 and send them to the correct server based on the requested URL.

        Steve

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