Best method to consolidate OpenVPN client connections

  • 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.

  • LAYER 8 Rebel Alliance

    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.


  • 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;

  • @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.