I have been providing my friends with censor-free internet access through my server via a OpenVPN network. Now that I have more virtual servers at different locations, how can I add them to my network?

I would like to implement a system which automatically redirects clients to the server with the lowest latency, most available resources, etc. by default. It would be nice to let some clients choose specific configurations at will (e.g. connect to any server in France, or any server except in Germany, etc.).

I just don't know where to start because I can't find any info about how to set up multiple servers to act as somewhat coordinated and load-balanced internet gateways for multiple clients.

Should I bridge the servers and run a DHCP server? Will I have to use the same certificate on all the servers? If not, how can put multiple configurations in one file? because every time I try to combine different client configurations in a single file with <connection> tags, OpenVPN client throws a "bla bla cannot be used in this context" error.

Any help would be much appreciated.


You need to decide how do you want to automatically direct or redirect the clients to a server. As OpenVPN does not have such feature itself, you will have to work around it.

You need to decide if a script that is executed at the client side is an acceptable solution. IMO, this would be the easiest way - a VPN starter script that the client provides with the needed parameters or input. The script can then query the status of the servers and choose the server to connect to.

I recommend having a private CA and a separate certificate for each server and each client. Look up "TinyCA" for management of not too many certificates.

You could also implement the automatic redirecting through DNS, but that's a bit more complicated. E.g. you could have a separate DNS entry for each client or a group of clients and change it, and then disconnect the client(s) when you want them to connect to another server.

Don't use bridging mode, it would only bring problems and overhead.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.