Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
72
rated 0 times [  72] [ 0]  / answers: 1 / hits: 57297  / 3 Years ago, sat, october 30, 2021, 11:23:17

Im using Ubuntu 13.04 with Gnome and I recently set up a (open)VPN. Is there any way to enable it by default? Each time I boot or even lost my connection, I have to enable the VPN manually. Is there an option I am missing?


More From » 13.04

 Answers
1

Through the Network Manager indicator nm-applet (the GNOME or Unity network tray applet installed by default), you can configure NetworkManager to automatically connect to a VPN when a network is connected.




  1. Click on the network tray applet and click "Edit connections...", or run nm-connection-editor.

  2. Select a network connection and click "Edit..."

  3. Check "Automatically connect to VPN when using this connection" and select the desired VPN in the drop-down list.

  4. Save.



nm-connection-editor screenshot






When this is enabled, there is a bug in NetworkManager that can break the "automatically connect to this network" function. (Edit: this bug has now been marked as "fix released" in Ubuntu 16.04). If NetworkManager tries to automatically connect and fails, you will see a line like the following in /var/log/syslog:



<error> [1401130450.367538] [nm-vpn-connection.c:1374] get_secrets_cb(): Failed to request VPN secrets #2: (6) No agents were available for this request.


It seems that NetworkManager fails to obtain the user's VPN password from gnome-keyring-daemon. One workaround is to let NetworkManager store the password in plaintext in the configuration file in /etc/NetworkManager/system-connections/. To do this:




  1. Open a terminal.

  2. sudoedit /etc/NetworkManager/system-connections/<VPN>, where <VPN> is the configuration file for your VPN (the filename is usually the name you assigned to your VPN).

  3. Change the line password-flags=1 to password-flags=0

  4. Save and exit.



NetworkManager will now store the VPN password itself (see man nm-settings for details), and the network autoconnect will work once again.


[#30074] Saturday, October 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amencisiv

Total Points: 9
Total Questions: 102
Total Answers: 118

Location: Tajikistan
Member since Tue, Mar 21, 2023
1 Year ago
amencisiv questions
Wed, Dec 28, 22, 12:58, 1 Year ago
Wed, Sep 28, 22, 18:24, 2 Years ago
Fri, May 13, 22, 19:08, 2 Years ago
;