1. Update

    sudo apt-get update -y
    sudo apt-get upgrade -y

  2. Install OpenVPN

    sudo apt-get install openvpn -y

  3. Go to the OpenVPN folder

    Use the command cd .. as many times you need to get into the root folder.
    Then type the command cd /etc/openvpn

  4. Download PIA connection files

    sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip

  5. Install unzip if you awlready don’t have

    sudo apt-get install unzip

  6. Unzip downloaded files

    sudo unzip openvpn.zip

  7. List files unziped

    ls -l

  8. Config OpenVPN with the server file you want (in this example mexico)

    sudo openvpn config-sever-mexico.ovpn

  9. Create a text file with your PIA user and password

    sudo nano pass.txt

    insert your username and password like this:

    press Ctrl+O then Enter

  10. Protect your pass.txt file

    sudo chmod 400 pass.txt

  11. Add the pass.txt to your .ovpn file

    sudo nano mexico.ovpn

    in the botton of the file insert this:
    auth-user-pass pass.txt

    press Ctrl+O then Enter

  12. Lets rename the chosen file to client.conf

    sudo cp /etc/openvpn/Mexico.ovpn /etc/openvpn/client.conf

  13. Setup OpenVPN auto start on boot

    sudo nano /etc/default/openvpn

    find and remove the “#” in front of AUTOSTART=”all”

    press Ctrl+O then Enter

    sudo systemctl enable openvpn@client.service

  14. Start OpenVPN

    sudo service openvpn@client start

  15. Install curl if you don’t have it

    sudo apt install curl

  16. Test the VPN with

    curl ifconfig.co
    dig +short myip.opendns.com @resolver1.opendns.com

    The result should be a different IP than yours, you can check your IP here in a device who don’t have a VPN actived

  17. Eventually you will need to update the connection to the PIA, to do this follow these commands:

    sudo service openvpn stop
    cd ../../etc/openvpn
    sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
    sudo unzip -o openvpn.zip
    sudo nano mexico.ovpn
    –add at end: auth-user-pass pass.txt
    sudo cp mexico.ovpn client.conf
    sudo systemctl daemon-reload
    sudo service openvpn@client start
    test your connection

Leave a Reply

Your email address will not be published.