sudo apt-get install apt-transport-https -y
wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
sudo apt-key add openvpn-repo-pkg-key.pub
export DISTRO='bionic'
wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list
sudo apt-get update -y
sudo apt-get install openvpn3 -y
Supported distributions:
Distribution | Release | Release name ($DISTRO) |
---|---|---|
Debian | 9 | stretch |
Debian | 10 | buster |
Ubuntu | 16.04 | xenial |
Ubuntu | 18.04 | bionic |
Ubuntu | 19.10 | eoan |
Ubuntu | 20.04 | focal |
Generate you OpenVPN configuration file OpenVPN-Config.ovpn
and place it at /ovpn/OpenVPN-Config.ovpn
.
Add alias to the ~/.bashrc
file
echo 'alias ovpc="openvpn3 session-start --config /ovpn/OpenVPN-Config.ovpn"' >> ~/.bashrc
echo 'alias ovps="openvpn3 sessions-list"' >> ~/.bashrc
echo 'alias ovpd="openvpn3 session-manage --config /ovpn/OpenVPN-Config.ovpn --disconnect"' >> ~/.bashrc
- Connect to the VPN:
ovpc
- List current active session:
ovps
- Disconnect VPN:
ovpd