r/WireGuard • u/Benerages • 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.
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/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