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

    Best method to consolidate OpenVPN client connections

    Scheduled Pinned Locked Moved OpenVPN
    4 Posts 3 Posters 393 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.
    • KOMK
      KOM
      last edited by

      I use a VPN provider that operates in three cities in my country. Each city has multiple servers in the form VpnProvider-City-openvpn-001, VpnProvider-City-openvpn-002, VpnProvider-City-openvpn-003 etc etc. When defining a VPN client connection, you must provide one IP address or host only. The field doesn't take aliases.

      Is there a way to somehow aggregate all the provider's servers into one alias or group so that if one is down it will connect to another? Right now, I have two specific city addresses configured as OpenVPN clients and added to a gateway group so it does load-balancing. I'd like to do this with all the other addresses, but that requires creating a separate OpenVPN client instance for each one, and I'd rather not have to create 2 dozen client connections. It would be nice if the OpenVPN client supported server lists and would connect to one at random at startup, for instance.

      1 Reply Last reply Reply Quote 0
      • RicoR
        Rico LAYER 8 Rebel Alliance
        last edited by

        Hmmm it should work to use multiple remote statements like remote x.x.x.x 1194 udp in the Custom options.
        pfSense/OpenVPN will make use of them in order listed in the config file.

        -Rico

        1 Reply Last reply Reply Quote 1
        • O
          oddussiben-3161
          last edited by oddussiben-3161

          you can make gateway groups with Trigger Level > Member Down
          works flawless

          for random server connect, add the following in openvpn client > Advanced Configuration >Custom options

          remote VpnProvider-City-openvpn-001 1197;
          remote VpnProvider-City-openvpn-002 1197;
          remote VpnProvider-City-openvpn-003 1197;
          
          1 Reply Last reply Reply Quote 1
          • KOMK
            KOM
            last edited by

            @Rico Thanks, this might be the cleanest solution.

            @oddussiben-3161 That would require me to define every single client connection in order to make them gateways and able to be added to a gateway group. This is exactly what I want to avoid. Thanks for you r reply though. I appreciate it.

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