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
Microstrategy Inc. (MSTR) Earnings Dates & Reports - TipRanks.com
If an 'Accessory may not be supported alert' appears on your Apple device - Apple Support
Www.mytotalrewards/Rtx
Insidious 5 Showtimes Near Cinemark Tinseltown 290 And Xd
Collision Masters Fairbanks
Grange Display Calculator
Stl Craiglist
Aiken County government, school officials promote penny tax in North Augusta
Declan Mining Co Coupon
Caliber Collision Burnsville
Chris Hipkins Fue Juramentado Como El Nuevo Primer Ministro De...
Cnnfn.com Markets
Playgirl Magazine Cover Template Free
Otterbrook Goldens
Www Craigslist Com Phx
London Ups Store
50 Shades Darker Movie 123Movies
Jellyfin Ps5
Mahpeople Com Login
Craigslist Appomattox Va
Aps Day Spa Evesham
Hewn New Bedford
Melendez Imports Menu
Brbl Barber Shop
European city that's best to visit from the UK by train has amazing beer
Sec Baseball Tournament Score
Chicago Based Pizza Chain Familiarly
Hdmovie2 Sbs
Delete Verizon Cloud
Lilpeachbutt69 Stephanie Chavez
Hannah Jewell
Free Tiktok Likes Compara Smm
Syracuse Jr High Home Page
Indiana Immediate Care.webpay.md
Exploring The Whimsical World Of JellybeansBrains Only
Timberwolves Point Guard History
Jack In The Box Menu 2022
M Life Insider
About My Father Showtimes Near Amc Rockford 16
Woody Folsom Overflow Inventory
Conan Exiles Tiger Cub Best Food
Iupui Course Search
Ratchet And Clank Tools Of Destruction Rpcs3 Freeze
Paradise leaked: An analysis of offshore data leaks
Horseneck Beach State Reservation Water Temperature
Product Test Drive: Garnier BB Cream vs. Garnier BB Cream For Combo/Oily Skin
Minecraft Enchantment Calculator - calculattor.com
O'reilly's Eastman Georgia
Basic requirements | UC Admissions
What Responsibilities Are Listed In Duties 2 3 And 4
Fishing Hook Memorial Tattoo
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.