Algo and OpenVPN

Virtual Private Networks (VPNs) create a virtual encrypted tunnel between a machine and a remote server. All internet traffic is routed through the tunnel so that data cannot be intercepted. VPNs are particularly useful when on a public Wi-Fi network or to access certain websites that are blocked when in another country.

Setting up a VPN first requires setting up a virtual machine. Initially I attempted to set up CentOS using VirtualBox but I encountered too many issues with disk and processing space. This was in large part due to the laptop I was using, which is five to six years old and running on a Pentium processor. A new laptop with a solid state drive and an eighth generation i7 solved this particular problem.

The next issue that I encounter was when I tried to install the CentOS instance through Virtual Box. I was able to get past most of the prompts but then encountered an issue where the cursor would not appear on the virtual box, making it impossible to make any selections for the install. I attempted to install using solely the keyboard, unfortunately this was difficult, and the install did not work correctly. Through troubleshooting, I was finally able to make the cursor appear by changing the “pointing device” under “System” to “USB Tablet”. At this point, it was pointed out that a Mint instance is easier to install and use than CentOS. I was able to create a Mint instance with no issues.

Once the Mint instance was created, it was time to create the Algo VPN. The first step of this was to create a droplet on DigitalOcean. Algo uses Ubuntu and the size is 1 vCPUs 1GB / 25GB Disk. I chose NYC1 as the region. Once the droplet was created, it was simple enough to download Algo. Loading it onto the VM was slightly more of a challenge, as it took several reboots of VirtualBox and the Mint instance after inserting the Guest Additions before it allowed two-way connection between Mint and my desktop to either mount a folder or to copy/paste across the platform. This could also have been avoided by downloading the Algo instance directly on the Mint instance. Once the download was available, all that was left was to run the pre-written scripts for installing core dependencies and remaining dependencies. After the dependencies install was complete, the config file had to be edited to allow specific users. Once there were users set up, the deployment could be run and the VPN installed itself. Configuring the VPN on the desktop required coping over the powershell script that was generated and running it with the given command. All of this worked without issue for me, so no troubleshooting was needed.

The OpenVPN was more complicated than the Algo VPN. I started by creating a new droplet, separate from the Algo droplet, to avoid and cross issues with dependencies. OpenVPN also requires a VM, so I used the same Mint instance as the Algo VPN. To begin with, I first created ssh keys, then installed OpenVPN and EasyRSA. EasyRSA was used to build the public key infrastructure (PKI). Once this was installed, the next step was to generate private keys and certificate request. This required creating directory structures and storing certificate and key files. Once this was completed, I was able to start configuring the OpenVPN service.

The first step is to edit the server configuration file to reflect where the VPN will run from. Then the ports and protocol were adjusted. After this, the server networking configuration had to be updated. This involves making changes to the firewall rules, and if done incorrectly, the VPN will not work because it will be unable to connect to a network. When making the updates to this config file, I had a typo which resulted in a complete lack of network connection. This will be discussed further down.

Enabling the OpenVPN server just requires running a start command on it, and then running a check to verify it was successful. Every OpenVPN client has to have its own configuration file, but I only made one since I only have one client (my desktop). I transferred the config file to my desktop. I downloaded the OpenVPN client for Windows, and when I launched OpenVPN and ran the config file. The install ran successfully and I was able to successfully connect to the VPN. However, I had no internet access. Through some Google searches, I discovered this was almost certainly an issue with the config files for the firewalls. Going back through these files, I discovered a typo. I fixed the typo, stopped the service and restarted it. Upon reconnecting my desktop to the VPN, I was able to access the internet successfully. This network error was the only major issue I encountered when setting up the OpenVPN.

Overall, Algo is significantly easier to set up that OpenVPN because Algo has its script packaged so all simply needs to be run. OpenVPN is more complicated, has more room for error, and overall requires a better understanding of how Linux works and what the commands that are being run do.