Confusion over VPN client setup

Hi Bart,

I’ve currently got a ticket open with PIA, for vpn connection dropping and failing to reconnect which may explain your letter from your ISP. I’m waiting for them to advise on a fix for the client config, in the mean time I’ve setup a cron script, to check the connection. To try this you will either need a keyboard and access to the console or ssh. I’m translating this from raspbian to OSMC, so If I make a mistake can someone please advise. Also I’ve not had a connection drop since I invoked the script, so a test would be good and If someone has a better script I would appreciate it. (Striked through is no Longer required:)

nano or vi /home/osmc/checkvpn.sh
Cron script removed
chmod +x /home/osmc/checkvpn.sh
sudo su (i’m running the cron script as root.)
crontab -e
Add the following:
removed
This will check if the openvpn is running every 5 min, and restart the service if its not. From reading the logs openvpn is existing on failing to reconnect. Again I have not had drop since I’ve activated this, So I will advise how well it works later. Also I will update if pia come up with a client fix.

As for my setup, console or ssh access required

sudo apt-get update
sudo apt-get install openvpn unzip

cd /etc/openvpn
sudo wget --no-check-certificate https://www.privateinternetaccess.com/openvpn/openvpn.zip
sudo unzip openvpn.zip
sudo vi or nano /etc/openvpn/pass.txt

top line: pia username
2nd line: pia password

sudo cp “UK London.ovpn” vpn.conf
sudo vi or nano /etc/openvpn/vpn.conf

locate line: auth-user-pass
and change to: auth-user-pass /etc/openvpn/pass.txt

sudo systemctl enable openvpn.service
sudo systemctl start openvpn.service

check your public ip is now the one provided by ISP.

curl ipinfo.io/ip

now do a google search for whats my ip on non vpn routed client and compare ip to osmc.

Thanks Tom.