Red Hat Bugzilla – Bug 483120
[enh] add 'connect automatically' for VPNs
Last modified: 2016-06-07 18:15:48 EDT
Description of problem: NetworkManager does not connect to a VPN when the "connect automatically" switch is selected.
Version-Release number of selected component (if applicable): NetworkManager-0.7.0-1.git20090102.fc10.i386
How reproducible: Always
Steps to Reproduce:
1. Select "Connect Automatically" in Editing $VPN
2. Restart computer
3. See a connection automatically establish
Actual results: VPN does not automatically connect (or attempt to connect)
Expected results: the VPN automatically connects
Additional info: this is an OpenVPN connection.
Still true with soon-to-be Fedora 11 and packages:
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.
More information and reason for this action is here:
*** Bug 509773 has been marked as a duplicate of this bug. ***
*** Bug 517800 has been marked as a duplicate of this bug. ***
I do not think that bug 517800 is a dupe of this one. Can you re-open that one?
(In reply to comment #5)
> I do not think that bug 517800 is a dupe of this one. Can you re-open that one?
It's a dupe because the fix for this bug will also include the fix for bug 517800.
Is there any update on this? I still have this problem in version 12.
(In reply to comment #7)
> I still have this problem in version 12.
Same for F13 btw
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '12'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 12's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 12 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Still the same in F14. Please update version number accordingly.
Same problem in Fedora 15. Does not connect automatically although 'Automatically start connecting next time' is selected.
Works if session is logged out/logged in, but does not work if reboot the OS as described above initially.
any hints or workarounds? same issue on FC 15
Created attachment 519128 [details]
Script to automatically connect to a VPN
I have the following workaround in place. It should be flexible enough to cover what you want I think:
Place the script at /etc/NetworkManager/dispatcher.d/99-autovpn and make sure it is executable. Make sure NetworkManager is set to NOT automatically start the VPN (since this is what the script does for you instead).
Basically, every time a network connection goes up or down, the script is run, and it matches connections against a triple of data (interface, NM network name, up or down).
In my case, it is set to wait until interface wlan0 connects to "My wireless network", and then starts the VPN named MYVPN. This also works around bug 517800.
1) Change wlan0 to the interface you want to wait for - this could also be eth0.
2) Change "My wireless network" to the name of the network you want to wait for (the name is specified in the NetworkManager configuration). You can just put * (without quotes) if you want to connect regardless of which network you go to.
3) Change "MYVPN" to the name of your VPN connection as specified in NetworkManager.
Obviously, you can make more than one case statement if you want more flexibility.
Each time the script is run, the triple is logged to syslog (/var/log/messages), so you can see what interfaces and network names do or do not trigger the VPN connection.
The script is actually general enough to do quite a few things with it. I have another script like this that detects when I connect to my university wireless network and automatically submits my user/pass to their "web login" page.
there is one more problem, when vpn connection closes during network glitch, it will not restore, despite of the option "connect automaticly". as another workaround i put in 99-autovpn such line:
case $2 in
nmcli con up uuid $MYVPNUID
little bit ugly, but it works
i have the same problem. "connect automatically" doesnt work
fedora 16 32-bit, openvpn
NetworkManager-0.9.7.0-2.git20121004.fc18 has been submitted as an update for Fedora 18.
NetworkManager-0.9.7.0-3.git20121004.fc18 has been submitted as an update for Fedora 18.
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.9.7.0-3.git20121004.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Do we really have VPN autoconnect? I thought we currently had only binding VPNs to connections.
NetworkManager-0.9.7.0-4.git20121004.fc18 has been submitted as an update for Fedora 18.
Yeah, currently we can just bind VPN to connections, which could serve as a means of auto-connecting.
However, "Connect automatically" checkbox and VPN reconnection when base connection is disrupted still need to be implemented. Back to ASSIGNED.
this feature have been missing for quite a while on gnome3 networkmanager .. any news of it coming back ?
You can use "systemctl enable openvpn@myconnection" to have it start automatically. However, openvpn has dns issues so I start (and restart) it manually anyway.
erm .. aint systemctl command is for connections configured using config file instead of networkmanager? ..
older networkmanager used to have a way to bind vpn tp connections which will auto-connect vpn when i'm connected to a particular network, but this feature have been missing in newer networkmanager, been waiting for several fedora releases for it to come back, but now on F21, its still missing.
FWIW, I'm no longer seeing this problem now that I'm running KDE. Must be something GNOME specific.
yes, its is gnome specific
Yes, the systemctl option is a workaround, not a solution.
You can still bind a vpn to a network, but you have to install and use nm-connection-editor. You will have to run it from the command line as well, since it doesn't show up in the gnome-shell activities view.
Not sure if my problem fits under this issue, if it doesn't I'll file a separate bug report.
By using the util "nm-connection-editor" the tickbox "Automatically connect to VPN using this connection" exists, and works if I manually connect to the selected Wifi.
However, my network is marked with "Connect Automatically" in NetworkManager and upon a reboot Network manager fails to connect to my wifi if the setting "Automatically connect to VPN using this connection", and I must connect manually to the WiFi network that should auto-connect.
Not a huge issue, but still annoying.
Yeah, I suspect this is a slightly different problem but I'm also seeing that on F20.
Update: found my particular issue with the wifi not connecting upon boot, by unticking the setting "Make available to other users" both on WiFi and on the VPN configuration, the issue disappears and both WiFi and VPN connects upon login.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Created attachment 1093445 [details]
Networkmanager autoconnect openvpn log
I have an update regarding this issue in Fedora 23 (the same behaviour was seen in fedora 22).
The issue is in my case that Networkmanager tries to connect a number of times when I login after a reboot, and after maybe 3-5 times, it bails out due to unsuccessful connection attempts.
When I manually connect to my wifi, openvpn autoconnects just fine.
The same issues is experienced when returning from sleep, and a cold boot.
For more information on the issue, see the attached log above: Networkmanager autoconnect openvpn log (journalctl -b --unit=NetworkManager)
The following settings is configured for my WiFi in nm-connection-manager:
"Automatically connect to this network when it is available"
"All users may connect to this network"
"Automatically connect to VPN when using this connection": VPN
NetworkManager and openvpn packages installed:
[root@hell tmp]# rpm -qa | grep openvpn
(In reply to Fredrik from comment #34)
> I have an update regarding this issue in Fedora 23 (the same behaviour was
> seen in fedora 22).
> The issue is in my case that Networkmanager tries to connect a number of
> times when I login after a reboot, and after maybe 3-5 times, it bails out
> due to unsuccessful connection attempts.
> When I manually connect to my wifi, openvpn autoconnects just fine.
The issue is not specific to VPN/Wifi or a specific type of connection. There are missing secrets. The connections profiles that should be started on boot cannot depend on user agents providing secrets, because such secret agents are not available yet. So if, for example, you have a Wi-Fi connection and you store a password in a keyring, the connection can't be activated until you log in and an agent may provide NetworkManager with the password from the keyring.
Nov 12 20:37:42 hell NetworkManager: <error> [1447357062.570348] [vpn-manager/nm-vpn-connection.c:1980] get_secrets_cb(): Failed to request VPN secrets #3: (4) No agents were available for this request.
(In reply to Jirka Klimes from comment #35)
> The issue is not specific to VPN/Wifi or a specific type of connection.
> There are missing secrets. The connections profiles that should be started
> on boot cannot depend on user agents providing secrets, because such secret
> agents are not available yet. So if, for example, you have a Wi-Fi
> connection and you store a password in a keyring, the connection can't be
> activated until you log in and an agent may provide NetworkManager with the
> password from the keyring.
> Nov 12 20:37:42 hell NetworkManager: <error> [1447357062.570348]
> [vpn-manager/nm-vpn-connection.c:1980] get_secrets_cb(): Failed to request
> VPN secrets #3: (4) No agents were available for this request.
Well in that case shouldn't the keyring and therefore the secrets be available after a successful login?
The issues are occurring post-login, and the nm-applet icon is flickering during the connection attempts until it stalls.
After the stalling and a manual connection to the wifi is attempted, the connection is established successfully - both to the wifi and the VPN.
So the issue seems to be a communication issue between the keyring and NetworkManager then?