# Automatically connect to VPN

**URL:** <https://discuss.kde.org/t/automatically-connect-to-vpn/14955>\
**Category:** Help\
**Tags:** plasma\
**Created:** [May 3, 2024, 8:29am UTC](https://discuss.kde.org/t/automatically-connect-to-vpn/14955 "2024-05-03T08:29:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curve7352](https://discuss-cdn.kde.org/user_avatar/discuss.kde.org/curve7352/32/6125_2.png) [@Curve7352](https://discuss.kde.org/u/Curve7352)\
**Post date:** [May 3, 2024, 8:29am UTC](https://discuss.kde.org/t/automatically-connect-to-vpn/14955/1 "2024-05-03T08:29:12Z")

</div>

I have set up a Wireguard VPN connection in the system settings. How can I get it to automatically connect when I am connected to my Wifi?

I tried:

- Wifi: Connect automatically with priority: 0
- Wifi: Automatically connect to VPN
- VPN: Connect automatically with priority: 0

But then it will not connect to the Wifi, saying something like “secondary connection failed”. If I untick the “automatically connect to VPN” box then it connects to the Wifi but won’t connect to the VPN unless I do it manually. I played around with these settings (e.g. giving the VPN a connection priority of 1 which I assume is lower) but it doesn’t work.

---

<div class="post-metadata">

**Author:** ![jkemming](https://discuss-cdn.kde.org/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@jkemming](https://discuss.kde.org/u/jkemming)\
**Post date:** [June 28, 2025, 9:35pm UTC](https://discuss.kde.org/t/automatically-connect-to-vpn/14955/2 "2025-06-28T21:35:09Z")

</div>

For anyone stumbling across this thread like me: I managed to get it to work by setting the VPN to “Connect automatically with priority” 1 and changing nothing else. Most importantly, don’t use the “Automatically connect to VPN” option on the Wi-Fi connection!
