OpenVPN is incredibly famous and a full-included SSL VPN (Virtual Private Network) programming. It executes OSI layer 2 or 3 secure organization expansion utilizing the SSL/TLS convention. Like a lot other well known programming, it is open-source, free programming and disseminated under the GNU GPL. A VPN permits you to interface safely to an uncertain public organization, for example, wifi network at the air terminal or inn. In numerous ventures and government workplaces, VPN is expected to get to your corporate worker assets. Another boundless utilization to sidestep the geo-impeded destinations/applications and increment your protection or security on the web. This instructional exercise gives bit by bit guidelines to designing an OpenVPN worker on Ubuntu Linux 20.04 LTS worker.
In this post, We will install and configure OpenVPN server on ubuntu 20.04 LTS.
Step 1: Update and Upgrade the System
You need to update and upgrade the current ubuntu repository and default packages by using the given command.
sudo apt-get update && sudo apt-get upgrade -y
Step 2: Get Your Public IP
You required Public IP address to configure OpenVPN server this is mandatory parameter by using following command.
Step 3: Download OpenVPN Script
Download the bash script to install OpenVPN server and need to make it executable by following command.
curl -O https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh
Step 4: Execute the Script
Execute the script by using the given command.
sudo bash openvpn-install.sh
In this step, You need to configure your Public IP Address.
Step 5: Ipv6 Configuration
In this step, You will be asked for IPv6 configuration, In my case i am going to use IPv6, Press here n button to set it.
Step 6: Port Configuration
In this step, You need to choose the OpenVPN server port.
Step 7: Protocol Configuration TCP/UDP
In this step, You need to choose Protocol, In my case i am going to use UDP.
Step 8: DNS Configuration
In this step, You need to select DNS server, Choose any one as per your requirement.
Step 9: Compression Configuration
In this step, You need to choose compression to enable or disable, In my case i am disabling it.
Step 10: Encryption Configuration
In this step, You can configure custom encryption, In my case i am going to use default encryption.
Step 11: Continue Installation and Configuration
Now you need to press any key button to continue the process.
Step 12: Creating User
In this step, You need to add your first OpenVPN user, You need to type here username to create it.
Step 13: Password Configuration
In this step, You need to configure configuration file with password or without password by choosing the given values.
Step 14: Config file .ovpn
after this you will the conformation and .ovpn file in user home directory, You need to download the this file to make vpn connectivity from anywhere of the world.
Step 15: Getting Status of Open VPN
Get Open VPN server service status by using the given command.
sudo systemctl status openvpn
Step 16: Start the Daemon
Start the Open VPN service by using the given command.
sudo systemctl start openvpn
Step 17: On Boot Enable Open VPN Daemon
You need to enable the Open VPN server service on boot by using the given command.
sudo systemctl enable openvpn
Step 18: Port Verification
Verify the Open VPN port by following the given command.
netstate -plntu | grep 1194
Step 19: Virtual OpenVPN Lan Card
Get verify the Open VPN virtual lan card to make connectivity.
Step 20: Daemon Controlling
Here you can find the more command to control the daemon.
sudo systemctl status openvpn-server
sudo systemctl start openvpn-server
sudo systemctl stop openvpn-server
sudo systemctl restart openvpn-server
sudo systemctl enable openvpn-server
sudo systemctl disable openvpn-server
Step 21: Update Firewall Rules
You need to open the port 1194 on ufw firewall if you have enabled it, Execute the following command for the same.
sudo ufw allow 1194
we have successfully install and configure OpenVPN server on ubuntu machine, Still you have any issue leave a comment.
How to Install OpenVPN in Ubuntu 20.04 LTS