OpenVPN client fine with Network Manager but not from command line

After installing network-manager-openvpn-gnome, I do manage to connect to some OpenVPN servers fine by importing some .ovpn files. However, I also want to do it directly on the command line with openvpn but I do not manage.

openvpn myvpn.ovpn

Seems happy, I can see the new interface with ip, but the connection does not work, it looks like a DNS issue.

The same myvpn.ovpn file imported in Network Manager works fine.

I tried to add the following at the end of the .ovpn file:

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

But it does not help. Any pointer? I have tried openvpn3 but it does not support TAP that I need.

Thanks in advance!


Solved.... I just needed to install openresolv So adding the lines mentioned above to the opvn files are necessary.