Skip to content

Instantly share code, notes, and snippets.

@dslaw
Last active January 14, 2019 01:08
Show Gist options
  • Save dslaw/b962da7325a9369f65bb5ef0c933b304 to your computer and use it in GitHub Desktop.
Save dslaw/b962da7325a9369f65bb5ef0c933b304 to your computer and use it in GitHub Desktop.
Setup PIA

After installing PIA provided ovpn files into /etc/openvpn, create a file under /etc/openvpn/pia.txt with your credentials in it. Then install network-manager-openvpn, which provides the update-resolv-conf script. Update the ovpn files to use the script, which resolves DNS issues:

IFS=$(echo -en "\n\b")
for f in $(ls /etc/openvpn/*.ovpn); do
    echo "script-security 2" >> ${f}
    echo "up /etc/openvpn/update-resolv-conf" >> ${f}
    echo "down /etc/openvpn/update-resolv-conf" >> ${f}
done

Or install openvpn-systemd-resolved from the repos and update the ovpn files to use the /etc/openvpn/update-systemd-resolved script, instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment