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:
    username
    password

    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. Reload daemons

    sudo systemctl daemon-reload

  15. Start OpenVPN

    sudo service openvpn@client start

  16. Install curl if you don’t have it

    sudo apt install curl

  17. Test the VPN with

    curl ifconfig.co
    or
    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
    https://whatismyipaddress.com/

Leave a Reply

Your email address will not be published. Required fields are marked *