How connect to open vpn server without gui?
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 100And now, how i can use this tunnel for surfing the Internet through a browser?
21 Answer
I cant imported file via gui, because ovpn config have string:route x.x.x.x 255.255.0.0 vpn_gatewayBug:
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):
Install openvpn
sudo apt-get install openvpnInstall openvpn-systemd-resolved
sudo apt install openvpn-systemd-resolved libnss-resolveEdit /etc/nsswitch.conf. Find string "hosts:" and replace to:
hosts: files resolveFor application which used /etc/resolv.conf directly create symlink:
ln -svi /run/systemd/resolve/resolv.conf /etc/resolv.conf
ls -la /etc/resolv.conf- Start systemd-resolved:
systemctl enable systemd-resolved
systemctl start systemd-resolved- Edit *.ovpn file, add:
script-security 2
up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved
down-preand at the end of file:
dhcp-option DOMAIN-ROUTE .- Connect to vpn and enjoy
sudo openvpn --config my-vpn.ovpn