First, run the apt command to apply security updates:
sudo apt update
sudo apt upgrade
DOwnload installation script using short url as follow and update chmod :
wget https://git.io/vpn -O openvpn-ubuntu-install.sh
chmod -v +x openvpn-ubuntu-install.sh
sudo ./openvpn-ubuntu-install.sh
Select UDP (recomendded), Port default, DNS use 1.1.1.1 or Google, client name, just give some name for example client-vpn, then openvpn will generate file client-vpn.ovpn in the /root directory
sudo systemctl status [email protected]
sudo systemctl start [email protected]
sudo systemctl stop [email protected]
sudo systemctl restart [email protected]
On Windows, install OpenVPN GUI and load client-vpn.ovpn file. From taskbar, right click OpenVPN icon and select appropriate vpn and click connect. OpenVPN will generate private/local IP addresses such as 10.8.0.1/32
ping 10.8.0.1 #Ping to the OpenVPN server gateway
ip route #Make sure routing setup working
## the following must return public IP address of OpenVPN server ##
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
You need to run the same script again for adding or removing a new VPN user to TLS certificate. For instance:
$ sudo ./openvpn-ubuntu-install.sh
This is summary from Ubuntu 20.04 LTS Set Up OpenVPN Server In 5 Minutes
Same