Most VPN service providers offer several servers to connect to around the world. When I first started using a VPN, I configured OpenVPN on my main home network router. To change which VPN server I was connecting to, I’d edit the OpenVPN server setting on the router admin page and restart the service. To simplify the process of switching servers, I developed a set of web pages and scripts to allow me to change the VPN server just by opening a web page and clicking on a country flag. This solution worked well, but as it was implemented using optware packages on a router running Tomato firmware, it wasn’t a very portable solution; anyone who wanted this functionality would have to purchase a router that supports open source firmware. After a recent router upgrade I decided to port the solution to the Raspberry Pi which offers a much better development environment and much lower cost than a router. The new version is easy to set up and has an improved user interface; I can set it up for friends and family who may not have much technical knowledge.
Here’s a screenshot of the management web page:
To change VPN servers, just click on a flag.
The list of VPN servers shown is generated dynamically, so you can modify the source XML file to tailor which servers are shown without having to modify the HTML page.
This implementation was built using the Private Internet Access OpenVPN service. It could potentially be modified to work with other OpenVPN service providers.
I have written an installation guide and uploaded it (along with the related files) to a github repository so that you can download it and build your own VPN client gateway. You can get the files from the github repository; click on the “Download Zip” button on the github page:
