KeyRoutines
TriggerFreetrigger.network.vpn

Run a routine when a VPN connects or disconnects on Windows

VPN connected or disconnected starts a routine when a VPN connection comes up, goes down, or either. Filter by part of the connection's name to watch just one.

How it works

  • Pick connects, disconnects or either.
  • The advanced name filter matches a VPN whose name contains words like WireGuard or Work.
  • Changes are reported once the network has settled.
  • The routine gets the change and the current network state.

Routines that use it

VPN up, work day on

When the Work VPN connects, Open app starts your work chat and Open URLs loads the intranet.

Tunnel dropped

When the VPN disconnects, Close app closes your torrent client and Show banner warns you.

Tidy log-off

When the work VPN disconnects in the evening, Restore layout puts your personal window layout back.

Settings

SettingWhat it does
OnFire when a VPN connects, disconnects, or either.
NameadvancedOnly a VPN whose connection name contains this (e.g. WireGuard, Work). Empty: any VPN.

Good to know

  • VPNs are spotted by their network adapter, so an unusual VPN may not be noticed.

Questions

Can I close an app automatically if my VPN disconnects?
Yes. Use VPN connected or disconnected set to disconnects, and add Close app for the app you want closed.
Can it watch only one VPN?
Yes. Type part of its connection name in the advanced name filter.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.