Automatically Disconnect When Switching Between VPNs

Bug #1215262 reported by Lonnie Lee Best
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Manager Applet
Expired
Wishlist
NetworkManager
Expired
Wishlist
NetworkManager-OpenVPN
New
Undecided
Unassigned
network-manager-vpnc
Expired
Wishlist
network-manager-vpnc (Ubuntu)
New
Undecided
Unassigned

Bug Description

I often need to switch between multiple VPNs throughout my workday.

I realize that I must disconnect from the current VPN (I'm connected to) before I can successfully connect to another. However, I'm tired of having to explicitly disconnect (using the Network Manager's GUI) each time I switch between VPNs.

Currently each time you switch to another VPN, if you are already connected to a different VPN, the VPN you want to switch to is grayed out; You must first disconnect by navigating through the Network Manager's Indicator Menu to VPN Connections > Disconnect VPN. Then you must repeat the same steps to connect to the other VPN you're intending to switch to. So, it takes about 6 steps to switch to another VPN.

Although I can appreciate how these additional steps emphasize the fact that you must disconnect from one VPN before connecting to another, now that this fact is clear, I wish that the connection manager would allow me to select another VPN (while I'm already connected to a different VPN) and then *Automatically disconnect* before connecting to the VPN I'm switching to.

If it is a priority to emphasize that "you'll be disconnected from you current VPN if you switch to another", then this fact would be more efficiently communicated via a warning dialog, upon selecting a different VPN.

This dialog should have a check box that says "Don't warn me of this in the future". So that once users understand that fact, they don't have to be burdened with additional unnecessary steps in the future.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: network-manager-vpnc (not installed)
ProcVersionSignature: Ubuntu 3.8.0-27.40-generic 3.8.13.4
Uname: Linux 3.8.0-27-generic i686
ApportVersion: 2.9.2-0ubuntu8.3
Architecture: i386
Date: Wed Aug 21 22:48:16 2013
InstallationDate: Installed on 2012-12-17 (247 days ago)
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: network-manager-vpnc
UpgradeStatus: Upgraded to raring on 2013-05-06 (107 days ago)

Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :
tags: added: saucy trusty
Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

This is step-eliminating enhancement that would be easy to implement.

Where's the best place to submit this proposal?

Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

This is the best idea ever. Can I get some love?

Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

I was able to implement this functionality for myself using autokey-gtk:
sudo apt-get install autokey-gtk

Essentially, I added a folder in the left-pane of Autokey and associated a hot-key with that folder. Then, under that folder I added 3 scripts to facilitate easier switching between the 3 VPNs I frequent through out my work day. Each script only contains one line.

Script 1 - Switch to VPN 1:

os.system("nmcli con down id 'VPN 2' ; nmcli con down id 'VPN 3' ; nmcli con up id 'VPN 1' &")

Script 2 - Switch to VPN 2:

os.system("nmcli con down id 'VPN 1' ; nmcli con down id 'VPN 3' ; nmcli con up id 'VPN 2' &")

Script 3 - Switch to VPN 3:

os.system("nmcli con down id 'VPN 1' ; nmcli con down id 'VPN 2' ; nmcli con up id 'VPN 3' &")

Now, anytime I hit this hot-key combination I've set, a context menu jumps under my mouse-cursor listing all 3 VPNs. When I click any particular one, it automatically disconnects from any of the other two and connects to the one I've selected.

Unfortunately, I was unable to find a nmcli command capable of disconnecting "all VPNs" that might be currently connected. Instead you have to specify the id of the vpn you want to disconnect. I understand the need to specify an id for connection, but I wish there was a general kill all for disconnecting.

I will try to propose this addition to the nmcli command and post back here at some point.

Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

I've posted the idea of:

nmcli con down allvpn

to a separate proposal:
https://bugs.launchpad.net/ubuntu/+source/network-manager-vpnc/+bug/1338382

The bug on this page (1215262), should focus on the gui aspects of implementing this same functionality.

Changed in network-manager:
importance: Undecided → Unknown
status: New → Unknown
Changed in network-manager-applet:
importance: Undecided → Unknown
status: New → Unknown
Changed in network-manager:
importance: Unknown → Wishlist
status: Unknown → New
Changed in network-manager-applet:
importance: Unknown → Wishlist
status: Unknown → New
Changed in network-manager-vpnc:
importance: Unknown → Wishlist
status: Unknown → New
Changed in network-manager:
status: New → Incomplete
Changed in network-manager-applet:
status: New → Incomplete
Changed in network-manager-vpnc:
status: New → Incomplete
Changed in network-manager:
status: Incomplete → Expired
Changed in network-manager-applet:
status: Incomplete → Expired
Changed in network-manager-vpnc:
status: Incomplete → Expired
Revision history for this message
dragon788 (dragon788) wrote :

I'm not entirely certain the graphical representation you are seeing is due to any limitation in Network Manager. While I agree there should be a disconnect all option for VPNs, I'm able to see and select multiple VPNs to connect to in the UI, and in some cases I would NOT like to have it force disconnect one connection to connect to another. What you may be seeing is a common issue where if you don't specify the name of the adapter to use (defaults to 'tun') then it trips over itself reusing the same name over and over for each connection. Simply changing the device name (it will create it when necessary as long as you have enough permissions) will allow you to have multiple connections and activate them at the same time.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.