Install OpenVPN on your LXC VPS (Note: Please open a support-ticket before you install, we need to enable the TUN device on your VPS for it to work as intended)
After support have enabled the device on your VPS, SSH into your LXC containerand execute following command:
# ls -l /dev/net/tun
If you see this it's correct:
Output: crw-rw-rw- 1 root root 10, 200 Dec 22 12:26 /dev/net/tun
Now it's time to install OpenVPN:
Update packages and install openvpn:
# apt update # apt dist-upgrade # apt install openvpn git
# git clone https://github.com/Nyr/openvpn-install # cd openvpn-install # bash openvpn-install.sh
Answer the questions from setup wizard according to how you want your setup. At the end you should receive a message like this:
Finished! The client configuration is available in: /root/client.ovpn New clients can be added by running this script again.
If everything worked, then the service should be started and enabled by the setup script.
Verify service is working:
# systemctl | grep openvpn openvpn-iptables.service loaded active exited openvpn-iptables.service openvpn-server@server.service loaded active running OpenVPN service for server system-openvpn\x2dserver.slice loaded active active system-openvpn\x2dserver.slice
# ps aux | grep vpn nobody 136 0.0 1.3 11780 6844 ? Ss 14:41 0:00 /usr/sbin/openvpn --status /run/openvpn-server/status-server.log --status-version 2 --suppress-timestamps --config server.conf
Congratulations! You now OpenVPN running!