Bug 425625

Summary: "Automatically connect to VPN" causes the primary connection to not connect.
Product: [Frameworks and Libraries] frameworks-networkmanager-qt Reporter: damien.j.s
Component: generalAssignee: Jan Grulich <jgrulich>
Status: CONFIRMED ---    
Severity: normal CC: lamarque, lukas.tinkl, postix
Priority: NOR    
Version First Reported In: 5.110.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=463250
https://bugs.kde.org/show_bug.cgi?id=435603
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description damien.j.s 2020-08-21 07:28:12 UTC
SUMMARY

Ticking "Automatically connect to VPN" on a wired or wireless connection causes the primary connection to not connect.

STEPS TO REPRODUCE
1. Go to "Configure Network Connections"
2. Select the connection > "General configuration"
3. Tick the "Automatically connect to VPN" checkbox and select VPN connection (in my case PPTP).
4. Restart PC / Laptop

OBSERVED RESULT

Neither the VPN nor the primary connection starts.

EXPECTED RESULT

Both the primary connection and VPN should connect.

SOFTWARE/OS VERSIONS
 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION

Kubuntu 20.04

This is the case with both my laptop (on wifi) and desktop PC (cabled connection). The VPN is valid and connects manually once the primary connection has been manually started.
Comment 1 Lamarque V. Souza 2020-11-01 04:48:58 UTC
This looks like a upstream problem: https://bugzilla.gnome.org/show_bug.cgi?id=785699

As a workaround I do this in my Gentoo Linux:

systemtray -> Notifications -> Applications: Configure -> Network Management -> Configure Events... -> Connection Activated

In "Run command field" add the path of a script like this:

    #!/bin/sh

    CONNECTION_NAME=connection
    VPN_NAME=vpn

    if nmcli | grep -q "connected to $CONNECTION_NAME" && ! nmcli c show $VPN_NAME | grep -q ActiveConnection; then
        nmcli c up $VPN_NAME
    fi
Comment 2 postix 2023-11-06 12:13:32 UTC
Basically the same as bug 463250, with the difference that in bug 463250 you set the VPN itself to auto-connect. Might be considered a duplicate though.