An Overview
A VPN, or Virtual Private Network, creates a secure and encrypted tunnel to the VPN server. It utilizes both client and server applications, allowing users to send and receive data as if their device were directly connected to a private network.
OpenVPN uses a combination of SSL/TLS for key exchange and AES encryption to secure data transmission. It works on multiple platforms and is available on most operating systems, including macOS, Linux, iOS, and Android. OpenVPN helps mask a user’s real IP address, providing anonymity when browsing the internet or accessing sensitive data.
How OpenVPN Works.

In this guide, I’ll show you how to connect an Android mobile device to a VPN server on EC2. This configuration will enable you to use the internet securely from your phone, even when connected to an untrusted network. Let’s get started!
STEP 1: Setting up open VPN server
Login to your management console, navigate to the EC2 Dashboard and then click “Launch instance”.

Choose on “AWS Marketplace” and type Open VPN. Select the first option with the free tier eligible tag.

On the next page click “Subscribe on instance launch” and select the t2micro which contain the free tire eligible tag.


Create a new keypair and download the keypair.

Then click on Launch Instance and wait for the instance to go to running state.

STEP 2: Server Configuration.
Open your terminal and SSH to your server as a root user in order to configure the admin side of VPN, to do that use the command below.
ssh -i "{keyname}.pem" openvpnas@{Your-IPv4-Public-IP}
Type yes for these 2 prompts want to configure your VPN.
Should client traffic be routed by default through the VPN?
> Press ENTER for default [no]: yes, should client DNS traffic be routed by default through the VPN?
> Press ENTER for default [no]: yes.


Upon you reaching the end, Change the user password. Enter a new password twice and you’re good to go.
sudo passwd openvpn
Copy the public DNS and IP address for your instance and paste the following on your browser.
https://your IP address:943/admin.

You see this following page.

If successful, you will be asked to accept the agreement and they would be seeing this page. On left page go to configuration and click on the VPN setting.

Scroll down and apply the following changes:
Make sure the toggle for the should client internet traffic be routed through the VPN? Yes
Change the toggle for her clients use specific DNS server to yes.
Primary DNS server 1.1.1.1
Secondary DNS server 8.8.8.8

You change the setting, and you’ll need to update the server, so click on “Update Running Server”.
To obtain the official open VPN connect app. Install the official OpenVPN connect app on your android device, and the open it.

Start the import process by entering the public Ip address of your running EC2.
Next you type the username and the password.


You’re all set! Time to explore the app.

Conclusion
Congratulations! You’ve successfully set up your own free VPN server on AWS. Now, you can enjoy a secure and private browsing experience with complete peace of mind. Happy surfing!
Add a Comment