Hi!
I see some strange (buggy?) behavior in NetworkManager’s handling of OpenVPN connections.
Here’s the situation: My laptop is on a wireless network, 192.168.1.0/24. This is the normal routing table:
lars@polaris:~> sudo /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
Now, I use NetworkManager to set up an OpenVPN connection. The OpenVPN connection is using a tap interface (company policy; not negotiable). The other (VPN) network is 192.168.2.0/24.
While communication within the VPN works as one would expect, NetworkManager always sets the tap (VPN) interface as the default route/gateway.
Thus, the routing table is now:
Destination Gateway Genmask Flags Metric Ref Use Iface
74.94.177.157 192.168.1.1 255.255.255.255 UGH 0 0 0 wlan0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0
192.168.1.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 tap0
Naturally, when I’m on a local network I want to route all traffic except that bound for IPs in the VPN through the local network.
I assumed that checking “Ignore automatically obtained routes” under the VPN Connection setting, IPV4 Settings, Routes would prevent this, but it doesn’t. Selecting “Manual” IPv4 settings and entering a manual route doesn’t work either - I still always end up with the same routing table.
Of course, one can fix the default route manually (“route add …”) after connecting to the VPN, but this feels like a terrible hack.
I’m on OpenSUSE 11.1, btw, with a fully up-to date system.
Does anyone have a suggestion how to make this work as intended?