Ticker

6/recent/ticker-posts

How can I connect to OPENVPN and receive a free VPN using an AWS EC2 instance?

 What is an Amazon EC2 instance?

An EC2 instance is nothing but a virtual server in Amazon Web Services terminology. It stands for Elastic Compute Cloud. It is a web service where an AWS subscriber can request and provision a compute server in the AWS cloud.

An on-demand EC2 instance is an offering from AWS where the subscriber or user can rent the virtual server per hour and use it to deploy his or her own applications.

The instance will be charged per hour at different rates based on the type of instance chosen. AWS provides multiple instance types for the respective business needs of the user.

Let us see in detail how to launch an on-demand EC2 instance in AWS Cloud.

How can I connect to OPENVPN and receive a free VPN using an AWS EC2 instance?

Step 1: 

Go to Services => Compute => EC2

Step 2: 

On the top right corner of the EC2 dashboard, choose the AWS Region in which you want the EC2 server.
Here we are selecting N. California. AWS provides 17 Regions all over the globe.

Step3: 

Click on ‘Launch Instance’ button

Step4:

1. Name and tags: input any name you want.

2. Application and OS Images (Amazon Machine Image): Select Ubuntu and Amazon Machine Image (AMI) and select free tier eligible

3. Key pair (login): create a new key pair

After create will auto download ".perm" file. Please keep this file for remote SSH client later.
4. The last step is to click Launch instance.

Step5: 

Go to Instances then you can see the status of the instance as Running after wait for a while.

Step6: 

Now let's start to config Ubuntu with cmd
1. Select your instance and click connect
2. Select SSH client and then copy text below to past on cmd

3. Go to folder that you store (.perm) file and then type cmd and press enter
4. Past text that we copy from number and then will connect and will ask yes/no then type yes
5. Type: "sudo apt update" and "sudo apt upgrade" then wait until finish.
6. type: "sudo -i" for access root
7. Type: "wget https://git.io/vpn -O openvpn-ubuntu-install.sh"
8. Type: "chmod -v +x openvpn-ubuntu-install.sh"
9. Start for add user OPEN VPN: "bash openvpn-ubuntu-install.sh"
10. Enter the same as photo below
 - This server is behind NAT. What is the public IPv4 address or hostname? "Press Enter"
 - Which protocol should OpenVPN use? "Press 1"
 - What port should OpenVPN listen to? "Press Enter"
 - Enter a name for the first client: "Type your name that want to create"
 - OpenVPN installation is ready to begin. "Press Enter"
11. Now your user OPENVPN is ready and then we start next step
12. For download file type: "cd /root && python3 -m http.server"
13. Now go back to AWS Instance => Left Panel Click "Security Groups" and then click on your security Group ID
14. Click "Edit inbound rules"
15. Click Add rule for:
Open port TCP 8000 for download file openvpn and after download we can delete.
Open port UDP 1194 for OpenVPN and click save.
16. Find your IP AWS and type :8000 (my ip 54.183.111.27:8000) and find your file VPN Config
17. Now you can close port 8000
18. For AWS now finished and we let start connect with OPENVPN Connect
 - If no have OPENVPN Connect you can click here to DOWNLOAD 
19. Open OPENVPN and click upload your file openvpn then click connect

20. Now is successful connected VPN



Conclusion

In this post, we have made a step-by-step tutorial on How can I connect to OPENVPN and receive a free VPN using an AWS EC2 instance?.I hope you liked it and please do share it with your friends and follow our social media for more.

If you face any problems with the code or have any questions, please feel free to ask in the comments section or contact us.

Post a Comment

0 Comments