NetworkManager forgets my VPN settings until I reboot
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
NetworkManager forgets my VPN settings until I reboot
When I log out and log back in, sometimes NetworkManager forgets my VPN settings - nm-applet shows the wifi connection as normal (and it works) but click on it and "VPN Connections" offers only "Configure VPN" or "Disconnect VPN". It fails to show the VPN that normally lives there.
The only way I've found to get it back to normal is to reboot - and then it's fine until I log out again.
Can you not simply disconnect and the reconnect again? I occasionally have my work PPTP VPN session break, and I'm forced to reconnect again. I've never bothered to monitor the connection, but one could with monitor NetworkManager like this
Code:
sudo journalctl -fu NetworkManager
That should help you capture what is occurring with the VPN session.
BTW, instead of rebooting, try restarting NetworkManager like this
Well, I wouldn't expect killing the nm-applet to work since it's just the front-end to NetworkManager, and it's the underlying network layer that needs to be restarted.
When I log out (KDE 4.14.18, openSUSE Leap) and then log back in my VPN connection is terminated, but this is what I would have expected anyway since it is not defined as a 'system' connection, but as a 'user' connection only. However, it does let me restart it without issue. I assume from your reference to 'nm-appet' that you're a Gnome user, and I wonder if Gnome is configured to remember sessions, and whether this influences the behaviour here. I think the 'gnome-tweak-tool' can be used to configure this?
<quote>
Also note that you need to have a proper ConsoleKit session running to be authorized to use NetworkManager. You can verify that using ck-list-sessions | grep is-local which should print is-local = TRUE. In case you see FALSE there, use a display manager like gdm to login and start i3. It will not work with xdm currently (as of 2012-06-04), unless you use a patched version.
</quote>
ck-list-sessions returns nothing for me (but NM is working presently). I don't know if it's a furphy or something I need to worry about.
i3 is pretty minimalist so I supply dbus from my .xinitrc file - so many things to worry about these days - consolekit, policykit, dbus ... and very little doco to go with them. It's just odd that it works in the first session after booting but forgets my VPN names when I restart X
i3 is pretty minimalist so I supply dbus from my .xinitrc file - so many things to worry about these days - consolekit, policykit, dbus ... and very little doco to go with them. It's just odd that it works in the first session after booting but forgets my VPN names when I restart X
I can understand that it is a little annoying with it's behaviour in your i3 environment. I guess you could consider using NetworkManager's CLI interfaces (nmcli or nmtui) to control the connectivity instead, and I note that the page I linked to also suggests 'netctl' as another option.
Oh that's interesting - something just timed out, I got a notify-send message saying the connection failed and now I can connect again with nm-applet!!!
Now I'm getting somewhere with this - maybe I can force it _down_ with nmcli instead of trying to get it up.
0 08:47 achar:~/ $ nmcli con
NAME UUID TYPE DEVICE
Beltsy aac37b3d-8b97-43c6-ad06-b494db7578b6 802-11-wireless wlp3s0
... so no sign of my other access points or my VPN
... I tried 'systemctl restart NetworkManager' but it didn't help
... no sign of the timeout event that reset things on 9th
Weirder and weirder ... although nmcli doesn't report anything but 'Beltsy', nm-applet reports my second access point 'Moldova' but not the VPN. When I try to connect to 'Moldova' I get a popup error:
Failed to add/activate connection
(32) No session found for uid 1545 (unknown)
Weirder and weirder ... although nmcli doesn't report anything but 'Beltsy', nm-applet reports my second access point 'Moldova' but not the VPN. When I try to connect to 'Moldova' I get a popup error:
Failed to add/activate connection
(32) No session found for uid 1545 (unknown)
(uid 1545 is me)
That is an interesting finding. Some Gnome-related regression perhaps?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.