1

I cant use mmci and gnome gui on my laptop, because have error:

sudo nmcli connection import type openvpn file OpenVPN.ovpn 
Ошибка: не удалось импортировать 'OpenVPN.ovpn':
 configuration error: unsupported 3th argument vpn_gateway to “route” (line 13).

But i succesfuly connected with:

sudo openvpn --config OpenVPN.ovpn 

and have opened tunnel:

tun2: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.0.10.6  netmask 255.255.255.255  destination 10.0.10.5
        inet6 fe80::1d06:5638:3178:e66d  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100

And now, how i can use this tunnel for surfing the Internet through a browser?

grinat
  • 21

1 Answers1

1

I cant imported file via gui, because ovpn config have string: route x.x.x.x 255.255.0.0 vpn_gateway Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/606365/comments/68

My vpn cant work with console because i have problem in dns, solution(based on Ubuntu 18.04 no DNS resolution when connected to openvpn):

  1. Install openvpn sudo apt-get install openvpn

  2. Install openvpn-systemd-resolved sudo apt install openvpn-systemd-resolved libnss-resolve

  3. Edit /etc/nsswitch.conf. Find string "hosts:" and replace to: hosts: files resolve

  4. For application which used /etc/resolv.conf directly create symlink:

ln -svi /run/systemd/resolve/resolv.conf /etc/resolv.conf
ls -la /etc/resolv.conf
  1. Start systemd-resolved:
systemctl enable systemd-resolved
systemctl start systemd-resolved
  1. Edit *.ovpn file, add:
script-security 2
up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved
down-pre

and at the end of file:

dhcp-option DOMAIN-ROUTE .
  1. Connect to vpn and enjoy
sudo openvpn --config my-vpn.ovpn
grinat
  • 21