Setting up OpenVPN Access Server in Amazon VPC – AWS

Pre-requisite:- Virtual Private Network and AWS

A VPN is a secure connection that allows you to connect to the internet through a private, encrypted network. When you use a VPN, all of your internet traffic is routed through a secure server and encrypted, so that third parties cannot intercept it. This is useful for protecting your online privacy and security, as it prevents others from being able to see what you are doing online or from accessing your personal information. VPNs are often used to protect against online surveillance and cyber threats, and they can also be used to access content that might be blocked in certain regions or countries.

Amazon Web Services

Amazon Web Services (AWS) is a cloud computing platform provided by Amazon. It offers a wide range of services, including computing, storage, networking, database, analytics, machine learning, security, and more. These services are provided over the internet, and they can be accessed through APIs or through the AWS Management Console, which is a web-based interface for managing AWS resources.

OpenVPN Access Server

OpenVPN Access Server is a software package that allows you to set up and manage a VPN (Virtual Private Network) server. It is based on open-source OpenVPN software and provides a secure and private connection between devices over the internet.

OpenVPN Access Server is designed to be easy to install and manage, with a web-based administration interface that allows you to set up and configure the VPN server quickly and easily. It supports a wide range of client platforms, including Windows, macOS, Linux, iOS, and Android, and it can be used to connect a variety of devices, including laptops, smartphones, and tablets.

Steps to Setup OpenVPN Access Server in Amazon AWS

To set up an OpenVPN Access Server you’ll need the following:

Step 1: Head on to Amazon AWS Dashboard, and choose a location from the dropdown on the right top to place your VPN.

 

Step 2: Click on Launch Instance.

 

Step 3: Give your instance a name.

 

Step 4: Click on browse more AMI.

 

Step 5: Click on AWS Marketplace AMIs and search for OpenVPN Access Server.

 

Step 6: Select the first one

 

Step 7: Assign an existing key pair 

 

OR

Create a new key pair

 

Make sure to download the new key pair as it cannot be downloaded in the future.

Step 8: Scroll down to storage and allocate it as per your wish (recommended 8 GB)

 

Step 9: Click on Launch instance

 

Please wait for a few minutes for it to get started.

Step 10: Log into the instance using SSH or Putty (SSH used here)

ssh -i "<Location and name of Key-pair>.pem" 
 root@<public IP or public DNS address>

 

Step 11: Type yes and agree

 

Step 12: Click enter on every choice to keep the default settings

 

 

Step 13: You will be logged off the instance as a new root user is created openvpnas, log in using openvpnas

ssh -i "<Location and name of Key-pair>.pem"  
openvpnas@<public IP or public DNS address>

 

 

Step 14: Create a password for the user openvpn and admin web portal.

sudo passwd openvpn

 

Feed in a password and make sure to remember it

Note: The password being typed will not be visible for security reasons

Step 15: Go to the following URL to access the admin web portal and change a setting.

https://<ip address of instance>:943/admin

 

Step 16: Click Proceed to <IP>(unsafe).

 

Step 17: Enter the username as openvpn and the password you entered in Step 14.

 

Step 18: Click Agree if an agreement is prompted.

 

Step 19: Click on VPN settings in the side pane.

 

 

Step 20: Scroll Down and toggle the Should client traffic be routed through the VPN to YES.

 

 

Step 21: Scroll to the bottom of the page and click save settings.

 

Step 22: Click Update Running Server.

 

Step 23: Click on User Management -> User Permissions to create a new user to access the VPN service.

 

That’s it the personal VPN server is ready for use.

To use the VPN

Head on to the following URL

https://<IP address of instance>:943/

Log in as openvpn if no new user created.

 

Choose the platform and download the bundled application. Click on the desired VPN to connect 

 

Note: The OpenVPN connect GUI may be different depending on the version.

That completes the process of connecting to the VPN, changing your location to the server’s location, and giving you the same public IP as the AWS instance.