Roll-Your-Own Open-VPN Server
An Alternative To A Commercial Offering Using OpenVPN
Many people find the thought of running their own VPN server worrisome and difficult, but this has to be the simplest, easiest solution that I have come across for anyone who wants a quick and easy answer that is very low maintenance. This is particularly useful if you already have a cloud server running somewhere, and you want to maximise it's use and get some additional value for money and functionality from it. The system requirements for this are very small indeed, but be aware that if you intend to use this for streaming, bandwidth restrictions or traffic quotas maybe something you need to consider. That said, many modern VPS providers are pretty generous with their allowances these days, and one might easily expect the most basic restriction being of the order of 1Tb or 2Tb per month without any additional cost implications. That said, for a single user or a family group or group of friends this will be plenty.
Using a VPS like this is often cheaper than buying into a commercial service and typically performs much better due to it's relatively low use levels.
Pre-requisites:-
Root ssh access to a VPS or other 'cloud' machine running either Debian, Ubuntu or CentOS with about 512Mb Ram available
Procedure:-
ssh into your server and run the following command with root priviliges (you know, connect using Zoc or Putty to your VPS, just like you would on your Enigma2 based device).
Run this command:
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
Sit back and watch whilst it runs. The automated assistant will guide you and ask a few simple questions here and there and give you all the guidance you need.
Once it ends, you can run it again to add more users, or to remove some of them or even to completely uninstall OpenVPN server.
This particular offering simply writes a .ovpn config' file for each user created which contains within it all the necessary certificates and authentication for the client machine to use. So, no need for messing about with usernames and passwords and fiddling about with correctly crafted, placed and referenced text and other config' files.
So, the next step will be to use this on your client machine. This could be your Formuler TV device (be it Android or Enigma2 based), PC/Laptop, Mac, Tablet or whatever. You just need to copy your client's unique .ovpn file into the client machine, point your OpenVPN client at it, and all the set-up and configuration is done for you.
How you copy your config file into your client machine will probably depend upon what equipment you have available and what operating system/s you use.
If using Windows, it is probably easier and simpler for you to simply use an FTP application like Filezilla, and connect to your VPS over SFTP. Once your config file has been copied into your windows machine, you can then transfer it to the client device over your LAN, or via a USB stick.
If using Linux or Mac, then just use the scp command.
Tip:- Most OpenVPN Client programmes will look for and require a file with a ".ovpn" file extension. The server discussed here will create that by default for you and you can just use it 'as is'. If however you wish to use this config on an Enigma2 based device, then the .ovpn file will need to be re-named to "openvpn.conf" and then placed in the /etc/openvpn/ directory of the device as the Enigma2 system and vpn client needs it to be done that way. So for example, if you created a config file on your server called "formulerf1.ovpn", you would need to copy it into your device and also rename it as well. This can be done all in one hit direct from the Enigma2 device using an ssh client like Zoc or Putty or the OpenWebIf Terminal like this:-
scp root@ip-address-of-server:formulerf1.ovpn /etc/openvpn/openvpn.conf
References:-
Source reference for the installation script:- https://github.com/Nyr/openvpn-install
VPS providers:-
Modern VPS providers make things very easy for us these days. Having chosen a provider you can typically be up and running within a couple of minutes. Make no mistake, these things are lightening quick, typically with access to Tier-1 networks/bandwidth, so you get an 'industrial-grade' server on a very robust and reliable back-bone.
I have no affilliation with any of the following organisations, but I do use both Digital-Ocean and Vultr personally and in my business life and am happy to recommend both of them.
https://billing.virmach.com/cart.php?gid=1
https://www.digitalocean.com/pricing/
https://www.vultr.com/pricing/
https://bitfolk.com/
https://www.hostinger.com/vps-hosting
The Late Night Linux Podcast currently has an affilliate offer available with Digital Ocean which offers a $100/60 Day freebie, so using this you can experiment and be as creative or as irresponsible as you like, (or if you just want to practice and hone your skills), you can do it for free for a while: https://do.co/lnl
Additional Notes & Thoughts:-
The following items are not actually necessary for the VPN server to run and to perform it's tasks. However, they can make life a little easier for the comfortable and convenient maintenance an upkeep of a VPS.
Cockpit:
Cockpit is a free and open source web-based system management application. Using Cockpit, anyone can easily monitor and manage servers via a Web browser. It is suitable for system administrators to perform simple tasks such as storage administration, inspecting journals and starting and stopping services.
To Install Cockpit on CentOs
To Install Cockpit on Debian or Ubuntu
After that everything is dealt with via a web-browser (including a convenient browser based terminal window) which will all be broadcast on Port Number 9090
So, for example, just open-up your browser and enter in the URL bar http://server-ip-address:9090/
There is a general reference article discussing Cockpit here:- https://www.unixmen.com/cockpit-a-begi…istration-tool/
Netdata:
Netdata offers unparalleled insights, in real-time, of everything happening on your VPS with stunning, interactive web dashboards and powerful performance and health alarms.
Everything you'll need for installing Netdata can be found here:- https://my-netdata.io/
If you would like to see a real-world live example of what it does, then look here:- https://london.my-netdata.io/default.html#m…cpu;theme=slate