Openvpn client using multiple Server address
My Openvpn server (Pfsense) has two external IPs for VPN connection.
External ip 01: 18.104.22.168 (Main)
External ip 02: 22.214.171.124 (secondary)
In the vpn client configuration, I put the IP "126.96.36.199" in the field: "Server host or address" and the other ip in "Custom options".
To prioritize the connection to the first IP, ie for the client OpenVpn to try to connect more often to the main IP, I put it again in "Custom options".
remote 188.8.131.52 50002; remote 184.108.40.206 50002
Is this the most elegant way to make openvpn client prioritize the connection to a remote IP?
It has no concept of "prioritization". It will keep trying the next server in the list if it gets disconnected or times out. Assuming it respects multiple duplicate entries, that may help, but ultimately it means that it will try the first one twice and then the second if the first two tries timeout.