How to create VPN with OpenVPN on Ubuntu Server AWS VPS Systems

Systems

 A little theory

What is a VPN?

A VPN, or virtual private network, creates a private network connection between devices on the Internet. VPNs are used to transmit data securely and anonymously over public networks. Its operations include hiding the user's IP address and encrypting data so that it cannot be read by those who are not authorized to receive it.

What is a VPN for?
VPN services are mainly used to send data securely over the Internet. A VPN has three main functions:

1. Data protection

Without a VPN, your personal data (such as passwords, credit card information, and browsing history) can be accessed and sold to third parties. VPNs use encryption to keep this sensitive information private, especially when connecting to public Wi-Fi.

2. Anonymous

Your IP address contains information about your location and browsing activity. All websites on the Internet use cookies and other similar technologies to track this data. They can recognize you every time you visit them. A VPN connection hides your IP address so you remain anonymous on the Internet.

3. Security

VPNs use encryption technology to protect your Internet connection from unauthorized access. It can also act as a shutdown mechanism, removing pre-selected programs in case of suspicious Internet activity. This reduces the chance of data being compromised. These capabilities allow companies to grant authorized users remote access to corporate networks.

 Tutorial

1

Get VPS server on AWS

Assign the input ports in AWS. Security group of the instance (VPS Server).

Type Protocol Port
TCP TCP 943
TCP TCP 945
SSH TCP 22
HTTPS TCP 443
TCP TCP 1194
2

Install and configure OpenVPN

3

Access OpenVPN Administration Panel

4

Settings OpenVPN Client

 What software do we need to carry out this tutorial?

Since we are going to use Ubuntu Server (Linux System) we will need these programs compatible with Windows.

 Commands

Below I detail the commands to be able to create your own Private VPN with OpenVPN and Ubuntu Server. Follow the steps and don't get lost , you will learn how to create your own Private VPN whenever you need it and in a very short time.

1

Install OpenVPN

For Oracle VPS servers (Oracle Cloud Infrastructure)

We eliminate IPTables

sudo systemctl enable ufw
sudo ufw allow 22
sudo ufw enable
sudo apt remove netfilter-persistent
sudo reboot

We restart the server

sudo reboot

Access as "root"

sudo su

As always, first make sure your system has up-to-date packages.

apt update

Next, install the dependencies.

apt -y install ca-certificates wget net-tools gnupg

We added the OpenVPN server to its repository list.

wget https://as-repository.openvpn.net/as-repo-public.asc -qO /etc/apt/trusted.gpg.d/as-repository.asc
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/as-repository.asc] http://as-repository.openvpn.net/as/debian jammy main"> /etc/apt/sources.list.d/openvpn-as-repo.list

Finally, update and install the OpenVPN server.

apt update
apt -y install openvpn-as

 Copy the key of the "openvpn" user that is provided to you at the end of the configuration.

2

Configuring OpenVPN in the Administration Panel

You can access with the user openvpn and with the key copied above to the administration panel of OpenVPN:

https://tuippublica:943/admin
https://yourdomain:943/admin

In the Configuration/Network Settings section change the IP/Hostname to the public IP/HostName of the server. Leave everything as it is and Save.

In the User Management/User Permissions section, change the "openvpn" user key in the "Local Password" section by pressing the "More Settings" button and Save.< br />
In the User Management/User Permissions section, edit the blank user with the "Auto-login" option activated. Change the user password by pressing the "More" button Settings" Save and Update Running Server.

For Oracle VPS servers (Oracle Cloud Infrastructure)

In the Configuration/VPN Settings section, look for DNS Settings and activate "Have clients use specific DNS servers"
In Primary DNS Server write 1.1.1.1 and in Secondary DNS Server write 1.0.0.1
Save and Update Running Server.

3

Settings OpenVPN Client

You can now access the OpenVPN server with the created user and download the compatible application at:

https://tuippublica:943
https://yourdomain:943

Where they can connect and download client software for their devices. Supported operating systems include Mac, Windows, iOS, Android and Linux.

Add manually

Url: https://tuippublica
Url: https://yourdomain

Press Next

Indicates the User: user@tuippublica
Indicates the user's Key

 Programming Courses

 C# Programming Course

Free
Curso de programacion C# Sharp
  • 12 C# Lessons with their exercises
  • 224 C# Exercises with the solution
  • 224 Very useful C# Sample Codes
  • Completely Free and without registration
  • Suitable for beginners and advanced
  • Suitable for everyone
Go to C# Course  

 Java Programming Course

Free
Java Programming Course - Free
  • 12 Java Lesson with their exercises
  • 224 Java Exercises with the solution
  • 224 Very useful Java Sample Codes
  • Completely Free and without registration
  • Suitable for beginners and advanced
  • Suitable for everyone
Go to Java Course  

 VB.Net Programming Course

Free
Visual Basic (VB.Net) Programming Course - Free
  • 12 VB.Net Lessons with their exercises
  • 224 VB.Net Exercises with the solution
  • 224 Visual Basic Sample Codes
  • Completely Free and without registration
  • Suitable for beginners and advanced
  • Suitable for everyone
Go to VB.Net Course  
Juan A. Ripoll - Systems Tutorials and Programming Courses © 2024  All rights reserved.  Legal Conditions.