Today I want to introduce an Open Source VPN software that's extremely simple to set up and completely free, helping you work more stably and securely from home during this pandemic season.
Specifically, in this post I'll walk you through installing and using OpenVPN on the Google Cloud Platform. Google Cloud Platform gives you $300 free to use when you create a new account, so if you do the math, you can use this VPN for free for up to 30 months. There are plenty of guides online for registering an account and getting that $300, so look into it yourself!
Installing OpenVPN on GCP
Once you have a GCP account, go to the dashboard at console.cloud.google.com and go to the Compute Engine section to create a VM.
Tip: If the page switches to a language other than English, you can add "&hl=en" to the end of the URL to switch it back to English.
In this section, create a new Instance with CREATE INSTANCE. On the left side of the screen, choose Marketplace and search for the keyword OpenVPN. Choose the first item, "OpenVPN Access Server," and Launch to initialize it.
Next we get to the initial config parameters for OpenVPN — basically everything's already set up to standard to run. But there are a few things to watch for:
- Zone: This is the location where we place the VPN server. Depending on your needs, you can choose different locations, but you should mostly pick the location closest to you to avoid delay. If you don't know which location a zone is, you can look it up here: cloud.google.com/compute/docs/regions-zones
- Machine Type: This is the server's resource config — by default it's 1 shared CPU and 1.7GB Ram, which is enough for personal use under 80Mbps. If you need more, you can increase it or adjust it after creation.
The remaining sections configure the ports needed for the OpenVPN service — we shouldn't turn these off. Hit Deploy to initialize.
You'll get taken to a page with the VPN Server's address and admin account info — don't close this tab yet.
So we've finished creating the VPN Server. Now let's configure this VPN Server a bit to help hide your IP and connect to the network.
Configuring OpenVPN
Go to the Admin URL from the tab above and log in with the Admin User - Admin Password info. OpenVPN's interface looks like the image — fairly simple and user-friendly.
Next, go to CONFIGURATION => VPN Settings, and in the Routing section, enable the "Should client Internet traffic be routed through the VPN?" option. This will help hide your real IP when connecting through the VPN, replacing it with the VPN Server's IP instead.
Also in this section, under DNS Settings, choose "Have clients use specific DNS servers" and enter CloudFlare's 2 DNS servers, 1.1.1.1 and 1.0.0.1. Then Save Settings and scroll up to choose Update Running Server.
So we've installed and configured the VPN Server real quick.
Installing an OpenVPN Client to connect to the VPN
Go to the Site Address in the Server info tab above. Log back in with the Admin User and Admin Password, and download the version matching your OS.
Or you can choose to download the Profile to import into the software without needing to type the User and Pass when using it, for convenience.
Enter the Admin User and Password to connect. So now you have your own VPN Server, for free.
Customization
- You can create multiple Users with different permissions in the User Management section.
- Customize the Private IP range, Https certificate, authentication method, etc. in the Configuration section.
Pros and cons
Pros:
- Fast, easy setup.
- Works across most platforms: Desktop, Mobile
Cons:
- Limited to 2 Connections
Wrapping up
Hope this post gave you a bit of new knowledge. Have a nice day.
If you're running into technical challenges or need help with systems, DevOps tools, I'm confident I can help. Get in touch at hoangviet.io.vn