This let you know how to run your own vpn server and connect client to it.
I use ubuntu as a server here, but expect it to work on other distros as well.
# let us assume username is ubuntu
mdkir /home/ubuntu/ov
cd /home/ubuntu/ov
curl -O https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh
chmod +x openvpn-install.sh
./openvpn-install.sh
Then you will find *.ovpn file on ~, where * would be what you configured as name. I am going to refer it ov.ovpn as an example. Copy this file(FTP or just copy content to clipboard on ssh terminal), and place it on your client's local directory
Enable inbound port 1194 for both UDP and TCP.
For detail instruction, you can visit angristan/openvpn-install.
Let us assume you placed ov.ovpn file on ~/ov directory.
Then, just sudo openvpn --config ~/ov/ov.ovpn
should work.
However, it causes DNS resolution problem, which is a problem that can't find ip by domain name.
So, for example, ping google.com
would fail.
Therefore, additional steps are needed.
sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome
Then, open setting -> Network -> VPN -> import from file -> choose ov.ovpn file -> click Add button. However, now password problem occurs. What's more, it's hard to detect as it doesn't notify you, but just doesn't work. To solve it,
# if you don't set vpn name as ov, then use that name instead of ov
sudo vi /etc/NetworkManager/system-connections/ov
And on the [vpn] section, set password-flags=0, then add a new section [vpn-secrets] like below
[vpn]
... some pre-existing parameters
password-flags=0
[vpn-secrets]
password="your-password"
Where "your-password" is your vpn password, which you chose while installing openVPN on server. If you haven't, this value can be any string.
For detail instruction, you can visit necromuralist's blog.