56 votes

How to refuse routes that are PUSHed by OpenVPN server?

Times have moved on, and as of 2017 (OpenVPN 2.4) this is possible with pull-filter accept "route 192.168." pull-filter ignore "route 172." pull-filter accept "route 1" pull-filter ignore "route " ...
Criggie's user avatar
  • 1,791
28 votes

Failed to request VPN secrets #3

In my case (In Debian 9 by Gnome 3.2) selecting the password option "Store the password for all users" in the VPN settings got it working. All other options produce the mentioned error.
shgnInc's user avatar
  • 728
25 votes

How to allow SSH into Terminal after connecting to VPN server using NordVPN servers through OpenVPN?

When using the NordVPN Linux client, iptables are used to change traffic instead of modifying the routes. To allow SSH to go through, you need to whitelist the SSH port. nordvpn whitelist add port 22
Nick Caballero's user avatar
23 votes
Accepted

iptables forward traffic to vpn tunnel if open

You will need both sets of rules within iptables. The two rulesets ensure that traffic leaving by the specified interfaces is appropriately masqueraded. Here is my suggestion, which is a little ...
Chris Davies's user avatar
21 votes

Import VPN config files to NetworkManager from command line

I'm using nmcli version 1.2.6 and I can use it to import openvpn configs. nmcli connection import type openvpn file ~/myconfig.ovpn From now on even in NetworkManager UI my vpn is visible. To ...
bastian's user avatar
  • 323
19 votes
Accepted

How to use --auth-nocache with correct TUN/TAP in openvpn?

You're storing your authentication data in a file. The fact that OpenVPN is additional storing it in RAM is then something you shouldn't care about. It's there for environments where you type the ...
derobert's user avatar
  • 110k
19 votes
Accepted

Use service or systemctl to control openvpn daemon on boot?

OpenVPN is not the best place to start if one is learning systemd, because OpenVPN is not a simple service. OpenVPN is a templatized service under systemd. The service units are named openvpn@config....
JdeBP's user avatar
  • 68.9k
19 votes

Open VPN options error: --tls-auth fails with 'ta.key': no such file or directory

To generate the tls-auth key: openvpn --genkey --secret /etc/openvpn/ta.key
marc's user avatar
  • 2,427
18 votes

OpenVPN - Understand the routing table + How to route only the traffic to a specific ip via the VPN

I don't understand the second default gateway, this is the default when the vpn is not active, is it simply bypassed? This is one of OpenVPN's hacks to route traffic through your tunnel while ...
smokes2345's user avatar
18 votes
Accepted

Find Local IP of VPN Client

From the tag, I'm guessing you're running OpenVPN. OpenVPN uses either tun or tap tunnels, so that'd be tun0. Then your local IP (on the VPN) is 10.8.0.1, which is oddly (as in it strikes me as a ...
derobert's user avatar
  • 110k
17 votes

How to make OpenVPN to listen both TCP and UDP ports

The same openvpn process can't listen on UDP and TCP sockets at the same time. You have two good options: use two tap interfaces for openvpn. Have two openvpn server processes, one for each tap ...
András Korn's user avatar
17 votes
Accepted

Ubuntu Server 16.04 - OpenVPN seems not to start, no logs get written

The problem is that service config /lib/systemd/system/openvpn.service just calls /bin/true (I have no idea on why it wasn't just removed). Usable configuration might be found in /lib/systemd/system/...
Wildfire's user avatar
  • 286
17 votes
Accepted

Where does GNOME Network Manager store passwords?

Go to the /etc/NetworkManager/system-connections/ directory, here all the connection details are saved. And use the cat command or any text editor as root to view the saved passwords. There should be ...
Arnab's user avatar
  • 1,581
16 votes

port forwarding to application in network namespace with vpn

Interconnecting network namespace with main namespace always bothers me. The reason I usually create a namespace is because I want it isolated. Depending on what it is you are trying to achieve with ...
AnyDev's user avatar
  • 739
12 votes
Accepted

How to use nmcli to always connect to vpn when using certain wifi?

Here's a detailed explanation from my initial comment. The goal is to learn what is the equivalent using the CLI tool nmcli without having to browse through all the documentation to pinpoint a setting ...
A.B's user avatar
  • 36.8k
12 votes
Accepted

Is there a command line program to check IP location (for VPN)?

You can use ipinfo.io or ipstack.com services through curl: curl --silent "https://ipinfo.io/ip" similarly change ip to country to get your geographical location.
Zeta.Investigator's user avatar
11 votes

Starting openvpn client as daemon - in debian

Use the Debian-supplied mechanism Don't roll your own service units. Debian comes with a mechanism for scanning your OpenVPN configuration and making systemd services to match it. Use that. Make a ...
JdeBP's user avatar
  • 68.9k
10 votes

How to define DNS server in openvpn?

On a Linux system, you need to run an external script. Here is the documentation: https://wiki.archlinux.org/index.php/OpenVPN#DNS Scripts are found on here or newer Linux version here and you can ...
Damien's user avatar
  • 201
10 votes
Accepted

Cannot rename resolv.conf file as root

As per your steps, you protected the file /etc/resolv.conf from being deleted/overwritten with chattr +i (immutable) So, you won't be able to move it to another file without doing sudo chattr -i /...
Rui F Ribeiro's user avatar
10 votes
Accepted

How do I stop daemonized OpenVPN connection?

Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill ...
ZleekWolf's user avatar
  • 709
9 votes
Accepted

How to allow SSH into Terminal after connecting to VPN server using NordVPN servers through OpenVPN?

I were able to find a solution for my issue by: when you connect to the Server by its public IP address, the return packets get routed over the VPN. You need to force these packets to be routed over ...
αԋɱҽԃ αмєяιcαη's user avatar
9 votes

NetworkManager fails with "Could not find source connection"

I got this bug even weirder. $ nmcli c up VPN Error: Connection activation failed: Could not find source connection. $ nm-applet # click icon, VPN, VPN WORKS! I learned that Network manager first ...
nmh's user avatar
  • 91
9 votes

NetworkManager fails with "Could not find source connection"

I had a long fight for this but this how I managed to find a workaround the issue in Ubuntu 18 using network-manager and GUI: Download GUI packages $ sudo apt-get install network-manager-openvpn ...
user117001's user avatar
9 votes

IP packet with unknown IP version=15 seen

Edit This question use to be, Why I have those error, not how can i solve the issue. I leave my answer as it might be useful to others. End of Edit According to this post OpenVPN Logs “IP Packet with ...
Kiwy's user avatar
  • 9,555
9 votes
Accepted

How can you run OpenVPN client inside a docker container?

I got it working. It looks like I have to enable IPv6 manually: docker run -it --rm --cap-add=NET_ADMIN --device /dev/net/tun \ --sysctl net.ipv6.conf.all.disable_ipv6=0 -v $PWD:$PWD \ ...
Pritzl's user avatar
  • 163
8 votes
Accepted

Change password in OpenVPN configuration file

If the key is in its own file, decrypt and re-encrypt it with a new passphrase: $ openssl rsa -aes256 -in acme.key -out acme.key.new $ openssl rsa -in acme.key.new -check $ mv acme.key.new acme.key ...
user4556274's user avatar
  • 9,015
8 votes

Failed to request VPN secrets #3

Not a solution, but a workaround. You can connect using the command line and also enter the username/password on the command line, therefore the secret agent is not needed. nmcli connection nmcli --...
Istvan Devai's user avatar
8 votes
Accepted

Not sure what starts this systemd unit file

You need to know two things: There are several more undocumented directories where systemd keeps unit files. Debian and Ubuntu supply a generator in /lib/systemd/system-generators/openvpn-generator ...
JdeBP's user avatar
  • 68.9k
8 votes
Accepted

OpenVPN daemon not using config file

If you're using a systemd based OS like Ubuntu 16.04 or Debian 9, you'll need to use the systemctl command instead of service: To enable at boot time: systemctl enable [email protected] To ...
Q23's user avatar
  • 413

Only top scored, non community-wiki answers of a minimum length are eligible