GNOME Bugzilla – Bug 656215
No way to mark a vpn connection as required
Last modified: 2020-11-12 14:33:48 UTC
(I'm reporting a bunch of bugs that I had today with nm. NetworkManager-0.8.9997-6.git20110721.fc15.x86_64) If I am using a VPN connection to protect data, I need a way for it to fail if the VPN connection goes down. Currently if my VPN connection dies, the data will be sent over the Internet and not over the VPN. It would be good to have a way to mark a VPN connection as required in the same way that a normal Internet connection can be marked as required.
Created attachment 193551 [details] Script to complain when tun0 dies
You can use a dispatcher script (vpn-down action) and do whatever you want from there (e.g. disconnect ethernet connection: nmcli dev disconnect iface eth0) See 'man NetworkManager' for detailed info about dispatcher scripts.
Thanks. Here is what I used to automatically disconnect all network connections when the vpn connection goes down or dies: /etc/NetworkManager/dispatcher.d/25-vpn #!/bin/bash INTERFACE=$1 # this will probably be 'tun0', but we don't check this STATUS=$2 # we are only interested in 'vpn-down' (and not 'vpn-up') case "$STATUS" in 'vpn-down') for i in $(nmcli -t -fields device dev); do nmcli dev disconnect iface $i; done ;; esac
Possible duplicate of #349151
(In reply to comment #4) > Possible duplicate of #349151 It's not a duplicate. (In reply to comment #2) > You can use a dispatcher script (vpn-down action) and do whatever you want from > there (e.g. disconnect ethernet connection: nmcli dev disconnect iface eth0) > > See 'man NetworkManager' for detailed info about dispatcher scripts. That's far from the integration we would need to implement this feature. We would need *no* network connection at all to be made before the VPN is successfully connected. Using a post script has a huge race window. This should also disable any connectivity checks until the VPN is connected.
bugzilla.gnome.org is being shut down in favor of a GitLab instance. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time. If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/ Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).