Bug 425625 - "Automatically connect to VPN" causes the primary connection to not connect.
Summary: "Automatically connect to VPN" causes the primary connection to not connect.
Status: CONFIRMED
Alias: None
Product: frameworks-networkmanager-qt
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.110.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-21 07:28 UTC by damien.j.s
Modified: 2023-11-06 12:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.