Bug#620821: ITP: vpnautoconnect -- Automatically reconnect VPNs, created by NetworkManager
For me, and many others, vpnautoconnect is the only way we have been
able to use a VPN with NetworkManager. Apparently, KVpnc works fine, but
I have not tried it.
Vpnautoconnect solves for me two very longstanding bugs in
NetworkManager that don't appear to have any progress. I don't know why
these bugs have languished for so long, but until there is some movement
on them I think the best bet in the near future is vpnautoconnect. I
have tried other methods, but vpnautoconnect is far more reliable.
Ideally, yes, NetworkManager would work. According to some comments in
the bugs listed below, the solution is not particularly simple. I don't
know if this is true, or why it this problem is taking so long to fix,
but reconnecting dropped VPN connections is really an essential
requirement.
problem 1: NetworkManager ignores 'connect automatically'
------------------------------------------------------------
The 'connect automatically' option in NM has no effect. This bug is
nearly five years old (!).
https://bugzilla.gnome.org/show_bug.cgi?id=349151
https://bugs.launchpad.net/network-manager/+bug/280571
Someone wrote a python script to drop in
/etc/NetworkManager/dispatcher.d/ in order to reconnect:
https://bugzilla.gnome.org/attachment.cgi?id=158670
But it is a bit hackish and requires editing to set UID and VPN name
configuration.
problem 2: OpenVPN and soft-restarts
-------------------------------------
openvpn soft-restarts frequently, but NM drops the connection. This bug
is 2.5 years old.
from https://bugzilla.gnome.org/show_bug.cgi?id=556134
> Since n-m-openvpn calls OpenVPN with the --up-restart parameter,
> OpenVPN calls back the nm-openvpn-service-openvpn-helper when it is
> restarted. In that case, nm-openvpn-service-openvpn-helper fails with
> exit code 1, resulting in bringing down the VPN connection. The
> reason for this is that OpenVPN doesn't set the same environment
> variables when calling the --up script at init and at restart. In
> particular, it doesn't set ifconfig_remote, route_gateway_1,
> ifconfig_local, route_network_1, route_net_gateway, route_vpn_gateway
> and route_netmask_1.
additional related bug reports:
https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/280160
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/330056
There is this script floating around:
http://ubuntuforums.org/showthread.php?t=1316314
This works similar to the other script above. I have not looked closely
to compare the differences. It also is in python, requires custom
editing, is a bit hackish, and gets dropped in
/etc/NetworkManager/dispatcher.d/ a
Reply to: