Workaround: LM 19.1 won't auto-connect to network if auto-connect VPN is set

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
Level 19
Level 19
Posts: 9216
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Workaround: LM 19.1 won't auto-connect to network if auto-connect VPN is set

Post by catweazel » Thu Apr 18, 2019 9:17 pm

I'm a firm believer in 'physician, heal thyself'. If I can't solve my own problems then I shouldn't be here trying to solve problems for others. I was at my wit's end with an issue that almost made me post asking for assistance. No amount of google-fu revealed a fix or a workaround. Fortunately I figured it out before I got as far as asking for help and losing all respect for myself :)

I'm running LM 19.1 Cinnamon and use a VPN. I should be able to specify that a particular network connection is to connect to a VPN automatically, but Mint will have none of it. If I remove the VPN auto-connection then the network starts as it should, automatically. If I want to start the VPN automatically then I have to manually start the network after logging in to the desktop. I haven't been able to solve the problem but I have found a workaround. I will add that I have tried multiple NICs (Intel and RTL) but the problem persisted.

So, you have a network connection and a VPN, both created in network manager and working when you manually start the network, followed by starting the VPN, but it doesn't work when the network connection in network manager is set to start the VPN automatically. From this point, the first step is to identify the network connection:

Code: Select all

boot@akhenaten:~$ nmcli con
NAME             UUID                                  TYPE      DEVICE 
AustraliaXXXXX   aae2d1d2-c064-4b3c-80db-afb20ae4124e  vpn       enp5s0 
RTL8111          bd2453c9-f8a2-30c5-8e7f-697a82acad63  ethernet  enp5s0 
tun0             4dacd325-e58b-44f6-83bd-8f9b7d1f373f  tun       tun0   
Intel i219-V     041447da-aaf8-3542-ae47-3cf997879e67  ethernet  --     
I want the machine to use the connection named RTL8111, and I want that connection to start the VPN without any intervention from me, which is what network manager is supposed to do but won't. Taking that connection name information, disconnecting from the network in the network manager, and manually bringing up the connection named RTL8111 in a terminal also fires up the VPN:

Code: Select all

nmcli con up id RTL8111
This tells us that the network connection defined in network manager can actually start the VPN automatically, despite Mint somehow not being able to figure it out.

The final step is to create a startup command in Cinnamon's Startup Applications, simply paste the nmcli con up id RTL8111 command in, save it and reboot. Of course, you must replace RTL8111 with the name of your connection.

Voila! Network up and VPN automatically connected.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
Level 1
Level 1
Posts: 6
Joined: Fri Apr 26, 2019 7:50 am
Location: Madrid, Spain

Re: Workaround: LM 19.1 won't auto-connect to network if auto-connect VPN is set

Post by PaulCarry » Fri Apr 26, 2019 8:10 am

Interesting. I haven't noticed this so far in LM 19.1 (although I haven't set my public VPN to auto-connect just yet) but will test it out this evening.

Thanks for the write-up (and heads up).

Level 1
Level 1
Posts: 11
Joined: Tue Jul 16, 2019 2:40 am
Location: Antwerp

Re: Workaround: LM 19.1 won't auto-connect to network if auto-connect VPN is set

Post by Zessofed » Tue Jul 16, 2019 2:44 am


Mint 19 installed on a Dell Precision M4800.
I've exactly the same problem.

I don't know if there is already a real solution for this?


Post Reply

Return to “Tutorials”