This guide describes how to connect to our service using OpenVPN on Linux, via terminal.
First, make sure openvpn is installed by running in terminal:
You can either set a one-time connection, which will be active in the terminal session until you disconnect (CTRL+C) or close the terminal, or you can set an active connection started by the openvpn service on-boot.
/etc/resolv.conf(not a statically linked file) such as:
systemd-resolvedis recommended (not using localhost as DNS resolver) because it is known to cause trouble with the DNS lookups while using the VPN connection. More info on how to disable it: here.
This method is for setting up an OpenVPN connection manually (one-time).
(sudo) openvpn [path to the .ovpn file]such as
sudo openvpn ./finland-aes256-udp.ovpn
auth.txtand add your VPN username and password, one per line. Create it either one of the editors like vim, nano or by using
echo "myvpnusername" > auth.txt; echo "myvpnpassword" >> auth.txt
auth-user-pass, change it to
sedutility to mass-change the files, such as:
sed -i 's,auth-user-pass,auth-user-pass auth.txt,g' *.ovpn
This method is for setting up an automatic/permanent OpenVPN connection managed by systemd.
/etc/openvpn/auth.txt(see step 2 above) and make the necessary change to the server profile
/etc/default/openvpnand specify which server profile to use by changing the
AUTOSTART=vpnacor what server profile you want to use.
(sudo) systemctl enable openvpn
(sudo) systemctl start openvpn
(sudo) systemctl stop openvpn
(sudo) systemctl disable openvpn