GNOME Bugzilla – Bug 560471
Possibility to make VPN connect when specific connections are used
Last modified: 2013-07-30 14:46:08 UTC
At university I have to connect to a VPN after connecting to the wireless network to be able to browse the network/internet. Would it be possible to make this automate'able ? I mean ... It would be nice if I could configure the University wireless network this way that it automaticcaly connects to one of the configured VPN networks on connection. Thanks for this great piece of software and all your work for the open source community.
Yes, this is something NM should allow.
*** Bug 523364 has been marked as a duplicate of this bug. ***
*** Bug 576527 has been marked as a duplicate of this bug. ***
*** Bug 579025 has been marked as a duplicate of this bug. ***
*** Bug 565108 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 563159 ***
wrong bug duped, sorry!
Created attachment 154900 [details] /etc/NetworkManager/dispatcher.d/02vpn-auto This is a workaround. Drop this script into your /etc/NetworkManager/dispatcher.d/ folder, and edit the two variables at the beginning to match the precise names of your VPN and school SSID. Your VPN cannot be available system-wide, and you should change the UID variable to match whatever "id -u" says. Also make sure it's owned by root and executable only by root. This works very well for me, in the meantime.
Notes on this have been added to the TODO file in git.
*** Bug 652003 has been marked as a duplicate of this bug. ***
From bug 664741: correct.horse@aol.com [reporter] 2011-11-24 16:19:52 UTC Hey, it would be very awesome if the keyfile configuration files supported [connection] autoactivate=$UUID (one or more autoactivate lines) and then do the following: when the pc is connected to that connection, automatically try to connect to the connection with $UUID. This would be very useful for me, as I am required to use a VPN in a specific WLAN and right now, I'd need to this via a dispatcher (which needs to check on every connection if it is the required one and then make networkmanager connect -- much ugly overhead). It would be much better if that were integrated :) Thanks for reading and that nice piece of software!
*** Bug 664741 has been marked as a duplicate of this bug. ***
*** Bug 680958 has been marked as a duplicate of this bug. ***
Comment from duplicate bug 560471: D.S. (Spider) Ljungmark [reporter] 2012-08-01 08:55:12 UTC For certain, known and authenticated Wifi connections ( as in, not by default on all of them) I want to be able to toggle "Always use VPN with this connection" This option should then let me to select a VPN to use, and "bind" it to the connection. It would then refuse to say it is "connected" until the VPN tunnel is established, and any failure of the VPN tunnel, should bring the wifi connection down to prevent information leakage. The main usecase here are known "hostile" wifi nodes ( Cafés, conferences and similar ) where you do not trust the local network.
*** Bug 680955 has been marked as a duplicate of this bug. ***
This is NOT a duplicate of 680955. #680955 is similar, but a current security issue where NM fails to re-enable VPN after suspend.
Yes. I originally thought it would be solved by fixing this one.
What do you think about removing the autoconnect option until it is working?
Feel free to patch NM in your favorite distribution. Doing it upstream makes no sense as it would take time to deliver it to distributions.
Well, I only partly agree. The advantages would be: * Downstreams could use the same patch as upstream, reducing problems with importing newer upstream versions later. * If it was added upstream, downstreams do not need to watch for when the feature is implemented since they get the reenabling code for the checkbox automatically when it is fixed upstream. A disadvantage is for testing during implementation, but that can be done in master/next/a topic branch where the checkbox is reintroduced.
That was just a remark, I don't really have an opinion on this one.
commit ece5e209cdc409a21e249dacbdbc953a1db4c6b7 Author: Jiří Klimeš <jklimes@redhat.com> Date: Tue Aug 21 17:49:41 2012 +0200 core: VPN autoconnect feature (bgo #560471) (rh #483120) We go through the SECONDARIES state where we check if there are some secondary (VPN or other) UUIDs that are to be activated before progressing to ACTIVATED. In case of an error with a secondary UUID or its activation, the base connection can't activate successfully.
Hi. Does this patch go into mainline? I'm using networkmanager 0.9.8.2 but this problem persists, namely 'Connect automatically' option when editing a VPN does nothing.
(In reply to comment #23) > Hi. Does this patch go into mainline? I'm using networkmanager 0.9.8.2 but > this problem persists, namely 'Connect automatically' option when editing a VPN > does nothing. You can now explicitly choose a VPN connection to always accompany your physical connection. Generic autoconnection of VPNs is not supported.
$ git tag --contains ece5e209cdc409a21e249dacbdbc953a1db4c6b7 0.9.7.995 0.9.7.997 0.9.8-beta1 0.9.8-beta2 0.9.8.0 0.9.8.2
(In reply to comment #24) > You can now explicitly choose a VPN connection to always accompany your > physical connection. How could I choose that?
I don't have knowledge about specific tools, it's the 'secondaries' attribute according to: https://projects.gnome.org/NetworkManager/developers/api/09/ref-settings.html
(In reply to comment #26) > (In reply to comment #24) > > You can now explicitly choose a VPN connection to always accompany your > > physical connection. > > How could I choose that? 1. Run "nm-connection-editor" 2. choose a base connection for which you want add VPN, click Edit 3. select "General" tab 4. tick "Automatically connect to VPN when using this connection" 5. select VPN connection to use