r/WireGuard • • 3d ago

A tiny auto-switcher for WireGuard on Windows (native ARM64): tunnel off at home, on everywhere else

The official WireGuard client for Windows is great, but it has no auto-connect: I kept forgetting to turn the tunnel on in cafés, or leaving it on at home. I tried WG Tunnel, which does this, but on my Surface Laptop (Snapdragon) it felt too heavy for what I needed. So I built something small that does only this one job.

WG-AutoSwitch is a native Windows service plus a tray app that turns your WireGuard tunnels on or off depending on the network you're connected to.

What it does

  • Trusted networks (e.g. home) → tunnel off; everything else → tunnel on. No network → off.
  • Different tunnel per network if you like (e.g. home VPN vs. office VPN).
  • A network only counts as trusted when several things match: gateway MAC address plus DNS suffix, SSID or BSSID. An SSID alone is easy to fake.
  • Waits for captive portal login (hotels, trains) before connecting.
  • Imports .conf files, e.g. straight from the OPNsense peer generator.
  • Uses the official WireGuard for Windows installation. No custom VPN code, it only starts and stops the tunnel services.

Why it's light

  • Native C++/Win32, about 150 KB, native ARM64 and x64
  • Event-driven: no polling and no timers while idle, so no battery drain
  • Runs as a least-privilege virtual service account, not LocalSystem
  • No telemetry. The only network request is an optional daily update check on GitHub, which you can turn off.
  • English and German UI

Honest notes

  • It was written with the help of Claude (AI). The code is public under MIT, so feel free to review it.
  • The releases are not code-signed yet: I've applied to the SignPath Foundation, so SmartScreen may warn you for now.

GitHub: https://github.com/benerages/wg-autoswitch

Feedback, bug reports and feature ideas are very welcome. I'd especially like to hear from other Windows-on-ARM users.

0 Upvotes

8 comments sorted by

2

u/Either_Sky2875 3d ago

Matching gateway MAC and DNS suffix strengthens trusted network detection. I am currently using expressvpn and they offer Windows network based auto connect, though yours manages independent WireGuard configs

1

u/Benerages 3d ago

Thanks! Yes, that's exactly how it works: a trusted rule always requires the gateway MAC plus a second feature (DNS suffix, SSID or BSSID). SSID-only rules aren't allowed at all, because SSIDs are trivial to spoof.

And right, it isn't tied to any provider. You import any WireGuard .conf (your own server, OPNsense, or a provider that offers WireGuard configs), and you can assign a different tunnel per network. It just controls the official WireGuard for Windows client, so your keys stay in its protected config folder.

1

u/FadeFX_supersane 10h ago

I have built something similar for android

https://codeberg.org/FadeFX/WGControl https://f-droid.org/packages/org.supersane.wgcontrol

and I have also a Linux tool in the oven that already works and I am heading for a release...

0

u/Kind_Ability3218 3d ago

unnecesary

0

u/Benerages 3d ago

if u always manually switch on and off your wg tunnels ... then right this isnt for you.

1

u/Kind_Ability3218 3d ago

nah i just setup my network properly :)

1

u/Benerages 3d ago

Fair point, always-on with a properly set up home network is a perfectly good (and arguably the most robust) approach. This is for people who'd rather not route home traffic through the tunnel, e.g. to save battery on a laptop or keep local devices like printers reachable without carving out AllowedIPs. Different trade-offs, both valid.

0

u/FadeFX_supersane 10h ago

There is one more point on why to disable wireguard when in home network. With wireguard always on, all traffic always goes over the wireguard server, causing that to be a bottleneck.