GNOME Bugzilla – Bug 545912
openvpn/tun0 device not in policy->manager list of devices
Last modified: 2008-10-11 14:04:43 UTC
Please describe the problem: Hi, The problems happens with svn 3882. here is the case : a tun0 openvpn interface is running on top of real device eth0, the default route is through the tun0 iface (no static route is sent by openvpn, so nm_system_device_replace_default_ip4_route() is called at the end of nm_system_vpn_device_set_from_ip4_config(). Now, a wlan0 device is configured as a shared device. When this device enters stage 5, update_routing_and_dns() is called, and here, the vpn tun0 iface is not considered as the _best_ default route. The loop iterates over eth0, and chooses eth0 as the best default route. The default route is then changed from tun0 to eth0, which is not the expected behaviour is this case. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
could this be caused because dev->priv->ip_iface == null for device eth0 ? the following patch works for me, it sets ip_iface to 'tun0' when the default route is replaced by the tunnel iface tun0.
Created attachment 115746 [details] [review] update device->ip_iface of the active device when vpn replaces the default route
Thanks for the report, definitely the wrong behavior on NM's part. I'll have to investigate a bit more, but I'm a bit worried about the side-effects of setting a real device's ip_iface. That won't work when the VPN connection is over 3G/PPP, since for those devices ip_iface is "ppp0" for example. So there's probably a better way to handle this given that VPN interfaces aren't real "devices". Will look into it.
Created attachment 120322 [details] [review] add a vpn-iface to nm-device I use this patch with some success since a few weeks. It works in the case of a 3G/gsm connection (ppp0), with a vpn connection (tun0) having the default route. It's a bit different from the previous patch, in the sense that it changes the behaviour of nm_device_get_ip_iface().
fixed in NM svn r4167