cm /tmp
wget https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh -O centos-8-vpn.sh
chmod +x centos-8-vpn.sh
sudo ./centos-8-vpn.sh
follow outputs and input your public IP. A openvep config file will be generated automatically.
Then, run openvpn.
sudo systemctl start openvpn-server@server.service
sudo systemctl enable openvpn-server@server.service
In addition to above, change firewall setting.
firewall-cmd --permanent --add-service openvpn
firewall-cmd --permanent --add-masquerade
firewall-cmd --reload
firewall-cmd --list-all
Reference:
https://www.cyberciti.biz/faq/centos-8-set-up-openvpn-server-in-5-minutes/