0

I got a .ovpn file from our "network guy".
I tried to import it to NetworkManager, but that didn't work:

 $ sudo nmcli connection import type openvpn file ~/.ssh/foo.ovpn

The connection appeared in the UI, but can't connect.

So I tried connecting on a command line:

sudo openvpn --config ~ondra/.ssh/arpage/ozizka@kufw1-1.arpage.ch.ovpn

This works. Although, all traffic goes through that VPN. The only thing that resembles the option "Only use this connection for it's traffic" in NetworkManager's UI is route remote_host, but openvpn complains about it, so I had to comment it out.

  • How can I change the routing in the .ovpn file?
  • Where is the reference manual for the .ovpn file?

Here's a part of that file:

client
dev tun
proto tcp
remote *** 20443
verify-x509-name "..."
#route remote_host 255.255.255.255 net_gateway
resolv-retry infinite
nobind
persist-key
persist-tun
auth-user-pass
cipher AES-256-CBC
auth SHA256
comp-lzo no
route-delay 4
verb 3
reneg-sec 0
<ca>
    ...
0

Not sure if remote_host has some special meaning or is an alias for 0.0.0.0. The issue at my side was that there was pseudo-default route pushed from the OpenVPN server: 0.0.0.0/1 routed to vpn_gateway, and that was somehow killing the traffic.

So originally I did

sudo route del -net 0.0.0.0 netmask 128.0.0.0
# Or - equivalently:
sudo ip route del 0.0.0.0/1

And later, the "network guy" removed it from the commands pushed by the OpenVPN server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.