You are not logged in.

#1 2014-09-04 20:46:44

Rorx
Member
Registered: 2014-09-04
Posts: 5

[SOLVED] NetworkManager doesn't use Openvpn routing table

Greetings everyone, I'm new to this forum.

I found this section to be the best for posting this problem, if it isn't, can mods reallocate it please?

I have seen this issue being addressed numerous times in other sites, but I haven't figured out how to fix it.

I'm running Cinnamon and started using NetworkManager (via nm-applet) to connect to my vpn, but NM doesn't let
Openvpn use it's own routing settings - it always overwrites them; I can vouch it's NM's fault because prior to
using NM I connected to the internet via only dhcpcd and used Openvpn @ xterm - back then everything was fine.

NM always routes all my traffic through my wired interface (enp3s0) instead of tun0 (additionally having DNS
leaks), yet I can fix this by connecting to the vpn and executing

sudo ip route add default dev tun0

But then again, everytime I connect to another vpn server or reboot I must do that.

Here are my current routing tables:

openvpn via xterm

default via 192.168.0.1 dev enp3s0  metric 202 
default via 192.168.0.1 dev enp3s0  proto static  metric 1024 
10.19.0.1 via 10.19.0.9 dev tun0  proto static  metric 20 
10.19.0.9 dev tun0  proto kernel  scope link  src 10.19.0.10 
128.0.0.0/1 via 10.19.0.9 dev tun0  proto static  metric 20 
176.126.236.26 via 192.168.0.1 dev enp3s0 
192.168.0.0/24 dev enp3s0  proto kernel  scope link  src 192.168.0.100 
192.168.0.0/24 dev enp3s0  proto kernel  scope link  src 192.168.0.100  metric 202 
local 10.19.0.10 dev tun0  table local  proto kernel  scope host  src 10.19.0.10 
broadcast 10.19.0.10 dev tun0  table local  proto kernel  scope link  src 10.19.0.10 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
broadcast 192.168.0.0 dev enp3s0  table local  proto kernel  scope link  src 192.168.0.100 
local 192.168.0.100 dev enp3s0  table local  proto kernel  scope host  src 192.168.0.100 
broadcast 192.168.0.255 dev enp3s0  table local  proto kernel  scope link  src 192.168.0.100 
fe80::/64 dev enp3s0  proto kernel  metric 256 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101
local ::1 dev lo  table local  proto none  metric 0 
local fe80::96de:80ff:fe15:4bd0 dev lo  table local  proto none  metric 0 
ff00::/8 dev enp3s0  table local  metric 256 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101

openvpn via NetworkManager

default via 192.168.0.1 dev enp3s0  metric 202 
default via 10.19.0.5 dev tun0  proto static  metric 1024 
10.19.0.1 via 10.19.0.5 dev tun0  proto static  metric 1024 
10.19.0.5 dev tun0  proto kernel  scope link  src 10.19.0.6 
176.126.236.26 via 192.168.0.1 dev enp3s0  proto static  metric 1 
192.168.0.0/24 dev enp3s0  proto kernel  scope link  src 192.168.0.100 
192.168.0.0/24 dev enp3s0  proto kernel  scope link  src 192.168.0.100  metric 202 
local 10.19.0.6 dev tun0  table local  proto kernel  scope host  src 10.19.0.6 
broadcast 10.19.0.6 dev tun0  table local  proto kernel  scope link  src 10.19.0.6 
broadcast 127.0.0.0 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  table local  proto kernel  scope host  src 127.0.0.1 
broadcast 127.255.255.255 dev lo  table local  proto kernel  scope link  src 127.0.0.1 
broadcast 192.168.0.0 dev enp3s0  table local  proto kernel  scope link  src 192.168.0.100 
local 192.168.0.100 dev enp3s0  table local  proto kernel  scope host  src 192.168.0.100 
broadcast 192.168.0.255 dev enp3s0  table local  proto kernel  scope link  src 192.168.0.100 
fe80::/64 dev enp3s0  proto kernel  metric 256 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101
local ::1 dev lo  table local  proto none  metric 0 
local fe80::96de:80ff:fe15:4bd0 dev lo  table local  proto none  metric 0 
ff00::/8 dev enp3s0  table local  metric 256 
unreachable default dev lo  table unspec  proto kernel  metric 4294967295  error -101

Is there any fix for NM you guys know of? Any thoughts of where to look? Thanks for your time.

Last edited by Rorx (2014-09-05 05:20:00)

Offline

#2 2014-09-05 00:56:29

farseer2012
Member
Registered: 2013-11-14
Posts: 7
Website

Re: [SOLVED] NetworkManager doesn't use Openvpn routing table

same

Offline

#3 2014-09-05 05:12:28

Rorx
Member
Registered: 2014-09-04
Posts: 5

Re: [SOLVED] NetworkManager doesn't use Openvpn routing table

A friend and me actually found the solution: It appears dhcpcd and NetworkManager cannot be running at the same
time, otherwise some networking tasks might not function properly (like this one); this also explains why some
people find sometimes two identical wired interfaces in the nm-applet (although different in values at the
routing table).

Our theory is this: The router sends dhcp info to the dhcpcd client and NetworkManager, but since dhcpcd starts
before NM and none of them is being run as a daemon, they collide when trying to write the routing table thus
both avoiding Openvpn setting it's own routing table (not forwarding all traffic through tun0).

So, first I stopped my wired interface service @ dhcpcd

sudo systemctl stop dhcpcd@enp3s0.service

Then disabled the service

sudo systemctl disable dhcpcd@enp3s0.service

Next, stop the client itself

sudo systemctl stop dhcpcd.service

And finally disable the service

sudo systemctl disable dhcpcd.service

You should leave only NM running (rebooting is recommended, so the system only starts NM). We have heard this problem
also arises with other clients such as netcl while dhcpcd is running.

This also fixes any DNS leaks anyone would have while using a vpn connection (Openvpn in my case).

Hope this helps anyone.

Offline

#4 2014-09-08 22:48:28

rsnd
Member
Registered: 2014-09-08
Posts: 1

Re: [SOLVED] NetworkManager doesn't use Openvpn routing table

so this is a problem with the dhcpcd overriding network manager, well done figuring this out and thanks for the solution.

Offline

Board footer

Powered by FluxBB