Deploy Linux VPN Server on Microsoft Azure

For some unspeakable reasons, this article can not expose too many details about every steps to setup and configure the VPN server, but the key steps and scripts will all be listed.

So you will need basic Linux command knowledge and some Azure experience in order to complete the operation.

The reason for choosing Linux over Windows is because the cost is way less then Windows machines, so that you can create multiple VPN servers across the data centers and have many fun.

First thing first, the Azure I am talking about is the global version of Microsoft Azure (azure.com), not the fake one in China (azure.cn), if you try to deploy any type of VPN services in Azure China, you will get a "friendly reminder" phone call right away!

1. Server Instance

You need to create an Ubuntu 16.04 LST VM, and only 16.04 works, do not try 17.10 or upgrade to 18.04, it won't compile the VPN server's source code!

Use your VPN Server Manager GUI to connect to your server, if the NSG Firewall is correctly configured, you should not have problem connecting to the server.

The configuration item should be executed in these order:

Make Certificate for public DNS name

Enable L2TP over IPSec

Enable SSTP

Enable NAT in VPN Hub

Create User Account

Restart VPN Hub

You can connect and use your VPN in L2TP/SSTP now on your PC/Mac or phone.

5. Auto Start VPN Service on the Server

By default, the vpn server will not start with the OS, so if your server restarted without your notice, you will need to manually SSH into the server and restart the vpn service. However, we can configure it to be auto start.