Implementing a load-balancing/failover configuration
-
After reading the OpenVPN documentation i have notice that it is possible to implement a load-balancing/failover configuration for client.
@http://openvpn.net/howto.html#loadbalance:
Implementing a load-balancing/failover configuration
ClientThe OpenVPN client configuration can refer to multiple servers for load balancing and failover. For example:
remote server1.mydomain
remote server2.mydomain
remote server3.mydomainwill direct the OpenVPN client to attempt a connection with server1, server2, and server3 in that order. If an existing connection is broken, the OpenVPN client will retry the most recently connected server, and if that fails, will move on to the next server in the list. You can also direct the OpenVPN client to randomize its server list on startup, so that the client load will be probabilistically spread across the server pool.
remote-random
If you would also like DNS resolution failures to cause the OpenVPN client to move to the next server in the list, add the following:
resolv-retry 60
The 60 parameter tells the OpenVPN client to try resolving each remote DNS name for 60 seconds before moving on to the next server in the list.
The server list can also refer to multiple OpenVPN server daemons running on the same machine, each listening for connections on a different port, for example:
remote smp-server1.mydomain 8000
remote smp-server1.mydomain 8001
remote smp-server2.mydomain 8000
remote smp-server2.mydomain 8001If your servers are multi-processor machines, running multiple OpenVPN daemons on each server can be advantageous from a performance standpoint.
OpenVPN also supports the remote directive referring to a DNS name which has multiple A records in the zone configuration for the domain. In this case, the OpenVPN client will randomly choose one of the A records every time the domain is resolved.
Although you can add entries in "Custom options" i don't believe its the appropriate method.
Adding the remote server and port via the interface would be more friendly and easy for every user to implement.I hope to add some support about it in upcoming 1.2 version.
-
The custom options are there for ppl who want to use custom functions (like a balanced server) ;).
Using this field is the right way :)