OpenVPN using terminal Setup Guide (2024)

  1. Install OpenVPN using your package manager if it is not installed already:

    Debian, Ubuntu, Mint:

    sudo apt-get install openvpn

    Fedora, CentOS:

    sudo yum install openvpn

    or

    sudo dnf install openvpn

    Arch, Manjaro:

    sudo pacman -S openvpn

    openSUSE:

    zypper install openvpn
  2. Download the OpenVPN config files to your home directory and extract the contents to a known location.

    Note: In most cases you want to use the UDP Protocol.

    unzip ivpn-openvpn-config.zipArchive: ivpn-openvpn-config.zip creating: ivpn-openvpn-config/ inflating: ivpn-openvpn-config/Austria.ovpn inflating: ivpn-openvpn-config/Australia.ovpn ...cd ivpn-openvpn-config/pwd/home/user/ivpn-openvpn-config

    In this case, the configuration files are in the ivpn-openvpn-config/ sub-folder of the user home folder. The full path is /home/user/ivpn-openvpn-config/.

    Note: Unless your Linux user account is called user the full path will likely be different on your computer system.

  3. You can initiate an OpenVPN connection by specifying the configuration file you wish to use. You will need to manually enter your account ID that begins with letters ‘ivpnXXXXXXXX’ or ‘i-XXXX-XXXX-XXXX’ and any password.

    Only your account ID is used for the authentication and is case-sensitive. The password can be anything, like "ivpn", if your client requires a non-blank password.

    sudo openvpn --config /home/user/ivpn-openvpn-config/Austria.ovpn

    or

    cd /home/user/ivpn-openvpn-config/sudo openvpn --config Austria.ovpn

    Note: If you close the Terminal window with an active VPN connection, the VPN will be disconnected. Please keep the Terminal window open. You can also disconnect the VPN by pressing `Ctrl+c` in the Terminal window. You will see a few extra lines as the connection cleans up.

  4. It is possible to create a file to store your credentials, which saves from entering them for each connection. Create a file called pass in a known location. This known location might be the same ivpn-openvpn-config/ from the previous steps. Enter your account ID (starts with ‘ivpn’) on the first line and any password on the second line:

    nano /home/user/ivpn-openvpn-config/passivpnADCdef123anyPasswordHere

    Press Ctrl+x to save the file and exit from the nano editor.

  5. Protect your credentials from other users on your computer system:

    chmod 400 home/user/ivpn-openvpn-config/pass
  6. Update the .ovpn files to point to your credential file. A single file can be edited manually:

    nano /home/user/ivpn-openvpn-config/Austria.ovpn

    Change the auth-user-pass line to auth-user-pass /home/user/ivpn-openvpn-config/pass. Press Ctrl+x to save the file and exit from the nano editor.

    All of the .ovpn files can be changed at the same time:

    cd /home/user/ivpn-openvpn-config/sed -i 's:auth-user-pass:auth-user-pass /home/user/ivpn-openvpn-config/pass:' *.ovpn
  7. After connecting to one of our OpenVPN servers, the internal DNS server for the VPN connection can be automatically added to the /etc/resolv.conf file if you have either the resolvconf or openresolv package installed. When the VPN connection is established, the resolvconf package will create a temporary backup of your computer system’s /etc/resolv.conf file and replace the contents with our internal DNS server. This is automatic on most distributions, but some Debian-based distros have trouble with the extra DNS.

    A temporary fix is to edit the /etc/resolv.conf file to make sure the only DNS server present is ours. First, find the VPN server IP address:

    ip a | grep tuntun0: <POINTOPOINT... inet 10.x.y.z/22 ...

    The corresponding DNS server for this 10.x.y.z IP address is 10.x.y.1. You could also use our global internal IP address: 10.0.254.1. Comment out all non-blank lines and add one for our DNS server:

    sudo nano /etc/resolv.conf# a comment is a line that starts with '#'##nameserver 192.168.0.1#search domainnameserver 10.x.y.1

    Press Ctrl+x to save the file and exit from the nano editor.

    You can undo the changes to the /etc/resolv.conf file by editing it with the nano editor and reversing the changes. The file will also be restored to the original state if you reboot your computer system.

  8. A more permanent DNS fix is available via this guide.

  9. If you wish to have the OpenVPN connection establish automatically with the system start, please see the following guides for Ubuntu and Fedora.

  10. Check your external IP to verify that you are connected:

    curl https://api.ivpn.net/v4/geo-lookup

    If you have the jq JSON parser program installed, it looks a little friendlier:

    curl https://api.ivpn.net/v4/geo-lookup | jq

Troubleshooting

  1. Most issues can be easily resolved by reviewing the logs. The diagnostic logging for the connection is available in the same Terminal window that you executed the connection command from. Some distributions will write OpenVPN logs to the syslog e.g. /var/log/syslog or /var/log/messages. You can filter VPN connection details with the grep command:

    grep -i vpn /var/log/syslog

Spotted a mistake or have an idea on how to improve this page?
Suggest an edit on GitHub.

OpenVPN using terminal Setup Guide (2024)
Top Articles
Brian Cullinan stock holdings and net worth by SEC Form 4 filings Mar, 2024
Can You Really Make Money Affiliate Marketing? 10 Reasons You Are Failing!
AllHere, praised for creating LAUSD’s $6M AI chatbot, files for bankruptcy
123Movies Encanto
Kathleen Hixson Leaked
Main Moon Ilion Menu
Kaydengodly
Chase Bank Operating Hours
Miles City Montana Craigslist
Apply A Mudpack Crossword
Zachary Zulock Linkedin
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Inside California's brutal underground market for puppies: Neglected dogs, deceived owners, big profits
The Weather Channel Facebook
Craigslist Boats For Sale Seattle
Guidewheel lands $9M Series A-1 for SaaS that boosts manufacturing and trims carbon emissions | TechCrunch
Lesson 8 Skills Practice Solve Two-Step Inequalities Answer Key
Katherine Croan Ewald
Roll Out Gutter Extensions Lowe's
Illinois VIN Check and Lookup
Why Should We Hire You? - Professional Answers for 2024
Faurot Field Virtual Seating Chart
Miltank Gamepress
Coomeet Premium Mod Apk For Pc
Sister Souljah Net Worth
How To Find Free Stuff On Craigslist San Diego | Tips, Popular Items, Safety Precautions | RoamBliss
Unity Webgl Car Tag
Hannah Jewell
Tokioof
Alima Becker
Tmj4 Weather Milwaukee
Wbli Playlist
Wednesday Morning Gifs
Hotels Near New Life Plastic Surgery
Dmitri Wartranslated
Cox Outage in Bentonville, Arkansas
Lake Andes Buy Sell Trade
Weekly Math Review Q2 7 Answer Key
Cabarrus County School Calendar 2024
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Noga Funeral Home Obituaries
Maplestar Kemono
The Quiet Girl Showtimes Near Landmark Plaza Frontenac
Fine Taladorian Cheese Platter
Laura Houston Wbap
Rovert Wrestling
Wera13X
Fredatmcd.read.inkling.com
The Goshen News Obituary
99 Fishing Guide
How Did Natalie Earnheart Lose Weight
Obituaries in Westchester, NY | The Journal News
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6636

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.