From Israel Amino
/
Step by step tutorial to build your own free VPN server
A VPN (Virtual Private Network) is important if you want to have safer and more secure browsing and also use it when you want to create access to a VPC (Virtual Private Cloud). Sometimes getting a VPN can be tricky, especially when you have to pay to use the service. In this article, I’ll show you how you can set up a working VPN server on AWS and you don’t necessarily have to pay anything at all to use it. Let’s get started.
Photo by Thomas Jensen on Unsplash
To start this tutorial, you need a free AWS account, so you won’t be charged to run a VPN on AWS. If you don’t have an AWS account, don’t worry, you can create one here that comes with 12 months free tier eligibility.
Log in to your AWS account, go to EC2 Service, and then click Launch Instance.
author photo
Then on the page, click on “AWS Marketplace” and type “openvpn” and select “OpenVPN Access Server”, the option containing the “Free Level Eligible” option and click select.
author photo
OpenVPN is an open source VPN server, in this case we are using Ubuntu AMI (Amazon Machine Image) to run the VPN, sometimes AWS market is better if you don’t want to go through the headache of configuring OpenVPN server by yourself.
After clicking Select, you will be directed to the page below. Remember, as I said earlier, OpenVPN is a free and open source VPN, but it is a commercial service but although we can be allowed to open two VPN accounts for free without paying anything by using the Bring Your Own License (BYOL) option that is the crux of the page shown here. Next, scroll down and tap Select.
author photo
Then you will be directed to this page, where the service will be running, select the t2.micro that contains the free tier eligible tag, then click “Review and Run”
author photo
After you click Review and Run, you will see a review of the instance you are about to create. If you read through you will see that the cost of running the service is $0.00 per hour. Click Play
author photo
Then you will see a popup asking you to create or use an existing key pair, this part is very important because you will need it through SSH to your server. If you don’t already have one, you can create a new key pair and download it to your computer. Then click on Launch Instances. In a few seconds, your instance will be up and running and you are good to go.
author photo
After your instance is launched successfully. Open the terminal and SSH on your server as root user to configure the admin side of the VPN, to do this use the command below:
ssh -i “
Your key pair is the one you downloaded recently or you have on your computer, also make sure you specify the path for your key pair so that it works, that is if it is in a different directory. Your public instance domain can be found on the EC2 dashboard. If entered correctly, you should see the terms of the license agreement, type Yes and enter.
author photo
After that, you will be asked how you want to configure your VPN, to leave the default settings, just keep pressing Enter and the configuration process will start for you. After this is done you will see instructions not to login as root but as user ‘openvpnas’ which is created by default.
author photo
Now SSH to the instance again, but not as root but as user “openvpnas” using the command below:
ssh -i “
Upon successful login, create a password for the user “openvpnas”, this will be the admin and client password to access the VPN gateway, you can do it with the command below:
sudo passwd openvpn
You will see a prompt to create a new password. And that’s it, you have successfully configured the server.
Congratulations on getting to this point of the tutorial, but before we start using it, we only need to enable one little feature in our VPN.
Copy the public DNS or IP address of your instance and paste the following into your browser:
http: //
You should see the following page:
author photo
If you don’t see this page, try using an incognito browser to open the web page. For the username, enter, “openvpnas” and the password is the one you created earlier in step 2. If successful, you will be prompted to accept the terms of the license agreement and after that you will see this page:
author photo
Now on the right page go to Configuration and click on “VPN Settings”
author photo
Then scroll down to routing and enable “Should a client’s internet traffic be routed through a VPN?” Selection:
author photo
Scroll down and tap Save Settings.
author photo
When you change the settings, you will need to update the server, so click “Update Play Server” and you are done!!!
Now let’s connect to the VPN…
Go to the URL and remove the admin path, it should be like this:
http: //
You should see the user login page, enter the same credentials you use to login to the administrator
author photo
Now select the operating system of your choice on which you want to use the VPN, follow the instructions and you are ready to go!!!
author photo
And that’s it. Thanks for reading and keeping safe 😃.
[ad_1]
Don’t forget to share this post with friends !