Blog thumbnail

Let's Make Our Own VPN ๐Ÿš€

In today's digital world, keeping your online activities private and secure is very important. A Virtual Private Network (VPN) helps you do that. Hereโ€™s a simple explanation of how a VPN works, using the diagram as a guide:

๐”๐ฌ๐ž๐ซ ๐‚๐จ๐ง๐ง๐ž๐œ๐ญ๐ข๐จ๐ง ๐Ÿ˜Š :

You start by connecting to the internet from your device (like a computer or phone).

๐•๐๐ ๐‚๐ฅ๐ข๐ž๐ง๐ญ ๐Ÿ”’ :

You open your VPN app (called a VPN client). This app scrambles your data so no one else can read it.

The VPN app sends this scrambled data to a special VPN server.

๐ˆ๐ง๐ญ๐ž๐ซ๐ง๐ž๐ญ ๐’๐ž๐ซ๐ฏ๐ข๐œ๐ž ๐๐ซ๐จ๐ฏ๐ข๐๐ž๐ซ (๐ˆ๐’๐) ๐ŸŒ:

Your data travels through your internet service provider (ISP), like Comcast or AT&T. They can see that you are sending data, but they canโ€™t read it because itโ€™s scrambled.

๐‘๐ž๐ฆ๐จ๐ญ๐ž ๐•๐๐ ๐’๐ž๐ซ๐ฏ๐ž๐ซ โ˜ :

Your data arrives at the VPN server, which unscrambles it and sends it to the website you want to visit (like https://abc.com).

This server can be anywhere in the world, so it looks like you are browsing from that location.

๐’๐ž๐ญ๐ญ๐ข๐ง๐  ๐”๐ฉ ๐˜๐จ๐ฎ๐ซ ๐Ž๐ฐ๐ง ๐•๐๐ ๐ฐ๐ข๐ญ๐ก ๐€๐–๐’ ๐„๐‚2 ๐š๐ง๐ ๐Ž๐ฉ๐ž๐ง๐•๐๐ ๐Ÿ”ฅ

Creating your own VPN using AWS EC2 and OpenVPN can further enhance your privacy and control over your data.

๐‚๐ซ๐ž๐š๐ญ๐ž ๐š๐ง ๐€๐–๐’ ๐€๐œ๐œ๐จ๐ฎ๐ง๐ญ:

1. Sign up for an AWS account at aws.amazon.com.

2. Launch an EC2 Instance

๐‚๐จ๐ง๐ง๐ž๐œ๐ญ ๐ญ๐จ ๐˜๐จ๐ฎ๐ซ ๐ˆ๐ง๐ฌ๐ญ๐š๐ง๐œ๐ž:

Use an SSH client to connect to your EC2 instance using the key pair you created during the instance setup.

๐ˆ๐ง๐ฌ๐ญ๐š๐ฅ๐ฅ ๐Ž๐ฉ๐ž๐ง๐•๐๐:

Update your package list: sudo apt-get update

Install OpenVPN and Easy-RSA

๐’๐ž๐ญ ๐”๐ฉ ๐Ž๐ฉ๐ž๐ง๐•๐๐:

Copy the Easy-RSA scripts to the OpenVPN directory: make-cadir ~/openvpn-ca

Start the OpenVPN server: sudo systemctl start openvpn@server

๐‚๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐ž ๐‚๐ฅ๐ข๐ž๐ง๐ญ:

Generate a client configuration file.

Transfer the client configuration file and certificates to your local machine.

Import the configuration into your local OpenVPN client.

๐‚๐จ๐ง๐ง๐ž๐œ๐ญ ๐ญ๐จ ๐˜๐จ๐ฎ๐ซ ๐•๐๐:

Launch the OpenVPN client on your device.

Import the configuration file and connect.