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

    Load balancing across 2 VPN instances

    Routing and Multi WAN
    1
    7
    616
    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.
    • W
      wtw
      last edited by wtw

      I was following https://www.techhelpguides.com/2017/06/12/ultimate-pfsense-openvpn-guide/ but did not succeed. I created 2 OpenVPN instances to the same provider, different locations.
      They both have interfaces configured. They both have Gateways configured. A Group Gateway was created. I created NAT Outbound entries, but I am not sure that is correct and/or that all entries are in the correct order. I created a LAN rule using the Group Gateway. I am also using Unbound for DNS over TLS. I am not sure how to configure that for this configuration. The Newtok Interfaces are LAN and WAN. WAN in this case is a DHCP LAN between the AT&T modem and the router. The Outgoing Network Intrfaces is LAN only. I want to use the VPN provider's URL for their locations and get the IP (one of several possible) using DoT before the VPN is running. By using LAN, it goes out the WAN until the VPN is running, then all following DoT goes out the VPN. But that is for the single VPN case. It does not seem to bo compatible with this dual-VPN case.

      6ac3a708-dffb-42f9-a7d6-a4e354f93322-image.png
      NAT Outbound:
      a90d3ed1-f670-490d-8afc-7bcaa0e09b73-image.png 45ca2aed-4a05-488e-ac49-e7656214dc8e-image.png

      Firewall LAN Rules:
      0222c1f3-62e8-4de1-8147-d0829f0ac700-image.png bc5929c0-0088-4f17-a191-4a92699e47bc-image.png

      How can I get this working correctly?
      How can I determine that it is working?
      I certainly need help understanding NAT Outbound entries better.
      Thanks.

      1 Reply Last reply Reply Quote 0
      • W
        wtw
        last edited by wtw

        Yes, pilot error again. NAT Outbound entries are processed from top to bottom where the first match exits (skips remaining entries). The same happens for WAN and LAN rules; firstmatch wins. Not necessarily so for Floating Rules, it is selectable. When I first created a VPN server, I followed a standard process that duplicated all the standard NAT Outbound entries for the OpenVPN interface (an Interface that only appears for Firewall Rules and NAT). I guess these work for simple VPN set ups. Adding a VPN provider using a single access point required no change. Now, for load balancing using multi-VPN instances, no longer valid.
        What I did:
        700edcd7-e4c2-40fd-8845-22d32643ace1-image.png
        Also need to adjust the LAN rule:
        efeea1a2-7ed0-41ff-ace7-ba890eda3429-image.png
        To let WANnet traffic (an AT&T modem LAN in my case) so I can access the device.

        Working well.
        This issue is resolved.

        1 Reply Last reply Reply Quote 0
        • W
          wtw
          last edited by

          Not quite right. DNS lookups are taking longer with VPN load balancing than without. Sometimes failing (timeout), which does not happen for the single VPN case.
          This probably is an Unbound configuration issue.
          DNS Resolver is using LAN and Localhost for Interfaces, and LAN (no others) for Outgoing network interfaces.

          So, a port 53 request originating on the LAN (or Localhost) gets converted to a port 853 request and gets routed to the LAN. This port 853 request should bypass Unbound and go to a VPN based on load balancing.

          So, what am I missing about this process?
          Any hints will be appreciated.

          1 Reply Last reply Reply Quote 0
          • W
            wtw
            last edited by

            Another issue. Only when I am running the load balance VPN tunnel pairs, a WAN capture contained:
            9ff05dd7-dc23-4cff-a722-6311504857f0-image.png
            What are these "ip-proto-17" packets?

            When I restarted both VPNs, they no longer appear. In the previous case, I restarted pfSense. One VPN started up, the other did not. I manually started it. Later one tunnel stopped carrying traffic and these packets started to appear for the VPN IP that was carrying packets.
            The IP address is the VPN server's address.
            There seems to be a start up issue. Is there a way to have conditional start ups (dependencies), so only one VPN at a time and after Unbound is set up?

            1 Reply Last reply Reply Quote 0
            • W
              wtw
              last edited by

              I have not been able to repeat the "ip-proto-17" issue (UDP is IP protocol #17), so it must have been an anomaly. There is a problem, but it does not appear to be a startup issue. Each VPN client is assigned the same tunnel gateway and subnet by the servers and I used the same client certificate for each one. One or both of these appear to cause clients that are not uniquely defined/identifiable. Continuing to work on this.

              1 Reply Last reply Reply Quote 0
              • W
                wtw
                last edited by

                It appears that the interface is defined by the gateway and/or subnet. Since all the VPN servers use the same subnet for client tunnels, this appears to not be possible. I could find no mapping strategy to get around this issue.
                Unfortunately, the client "interface" is not defined as a separate entity using the client certificate for uniqueness, it is derived from the gateway and/or subnet (IP based). So, when the clients are added, the first one defines the interface for IP addressing, the additional ones just cause some confusion.
                A 1:1 NAT inside the OpenVPN client to translate the tunnel subnet to a different outward facing one would resolve this issue.
                I don't know what else could.
                Suggestions will be greatly appreciated.

                W 1 Reply Last reply Reply Quote 0
                • W
                  wtw @wtw
                  last edited by wtw

                  @wtw
                  This is not resolvable without changing OpenVPN to incorporate a 1:1 NAT to completely hide/isolate the conflict from pfSense.
                  I consider this issue closed.

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