
David TimothyEvery developer has a familiar morning ritual: power on the workstation, grab a fresh cup of coffee,...
Every developer has a familiar morning ritual: power on the workstation, grab a fresh cup of coffee, fire up the terminal, and wait for local containers and background daemons to spin up.
Except lately, Windows 11 has been injecting an infuriating obstacle into that workflow: roughly five to ten seconds after reaching the desktop, your Wi-Fi silently disconnects. You open the network tray, hit connect manually, and it reconnects immediately without missing a beat for the rest of the workday. Reboot tomorrow, however, and the cycle repeats.
If you run an always-on VPN with a persistent, strict kill switch (such as Mullvad's Lockdown mode, IVPN's Always-On Firewall, or a locked-down WireGuard interface), this is not hardware degradation, access-point instability, or a corrupt Wi-Fi driver.
It is a silent race condition between Windows 11's network connection heuristics and your VPN's low-level packet filter. Here is what is happening under the hood, how to inspect the diagnostic traces in Event Viewer, and the one-line registry fix that permanently resolves it.
To understand why the wireless link drops, we need to inspect three distinct Windows networking components that boot simultaneously:
Modern privacy-focused VPN clients do not wait for a user GUI to launch before establishing protection. They install persistent filters directly into the Windows Filtering Platform (WFP) at the kernel level.
When you enable a "Hard Kill Switch" or "Lockdown Mode", these WFP callout drivers enforce a strict rule right from machine initialization: block all outbound and inbound IP packets unless they route through the virtual TUN/TAP adapter or target the specific IP/port of the upstream VPN gateway.
As soon as an adapter comes online, the NCSI engine tries to answer a basic question: Does this interface actually reach the public internet?
To verify reachability, NCSI executes active probes:
dns.msftncsi.com).http://www.msftconnecttest.com/connecttest.txt).If the probe returns the expected text, Windows displays the standard "Internet access" globe. If it times out or returns unexpected content, Windows tags the interface with "No internet access" or "Limited connectivity".
WcmSvc) and Bad State Tracking
The Windows Connection Manager service (WcmSvc) monitors available network interfaces (Wi-Fi, Ethernet, WWAN) and decides which connection the operating system should prioritize.
To help casual users avoid stuck states on degraded Wi-Fi networks, Microsoft introduced an aggressive health evaluation feature known as Bad State Tracking. When a Wi-Fi connection is associated with a router but fails to complete NCSI reachability probes, WcmSvc treats the interface as defective or dead.
Here is how those three components trip over each other during the first ten seconds of booting:
sequenceDiagram
autonumber
participant AP as Wi-Fi Access Point
participant NIC as Wi-Fi Adapter (WlanSvc)
participant WCM as Connection Manager (WcmSvc)
participant WFP as VPN Kill Switch (WFP)
participant VPN as VPN Tunnel Daemon
NIC->>AP: L2/L3 Association & DHCP complete
WFP->>WFP: Boot-time kill switch active (Drop all non-VPN traffic)
NIC->>WCM: Link UP (Local IP assigned)
WCM->>WCM: NCSI fires HTTP probe to msftconnecttest.com
WCM--xWFP: Probe BLOCKED by firewall (Tunnel not ready yet)
Note over WCM: NCSI probe failed -> State: "Limited Connectivity"
Note over WCM: Bad State Tracking triggers: "Interface is degraded"
WCM->>NIC: Force Disconnect / Reset Wi-Fi Association
VPN->>NIC: Cannot reach VPN Gateway (Physical link severed)
Note over VPN: Connection loop: Physical link dead, VPN blocked
WcmSvc evaluates the failed probes, concludes that the Wi-Fi link is unusable, and orders the WLAN stack (WlanSvc) to terminate the wireless association in an attempt to trigger an automatic network recovery.If you want to verify that this exact mechanism is causing your drops, you do not need third-party tools. The diagnostic trail is recorded in the Windows Event Log:
Win + R, type eventvwr.msc, and press Enter.Applications and Services Logs > Microsoft > Windows > WLAN-AutoConfig > Operational
Recovery Type: 4, Trigger Reason: 5.When correlated with the NCSI/Operational log showing ActiveHttpProbeFailed, the diagnosis is clear: Windows is intentionally dropping a healthy local Wi-Fi connection because it cannot distinguish between a broken router and a firewall intentionally blocking test packets.
EnableBadStateTracking
To stop Windows from unilaterally severing your Wi-Fi connection, you can instruct WcmSvc to disable its bad state disconnect behavior through the Windows Registry.
Click the Start menu, type cmd, right-click Command Prompt, and select Run as administrator.
Paste and execute the following command:
reg add "HKLM\SOFTWARE\Microsoft\WcmSvc" /v EnableBadStateTracking /t REG_DWORD /d 0 /f
For PowerShell users running as Administrator:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc" -Name "EnableBadStateTracking" -Value 0 -PropertyType DWORD -Force
HKLM\SOFTWARE\Microsoft\WcmSvc: Points to the configuration tree of the Windows Connection Manager service./v EnableBadStateTracking: Defines the registry value name responsible for tracking and acting on degraded network states./t REG_DWORD: Sets the data type to a standard 32-bit unsigned integer./d 0: Assigns a value of 0 (Disabled)./f: Overwrites any existing entry without prompting for confirmation.Restart your PC. Because WcmSvc is a core service loaded early in the Windows architecture, a complete reboot is required for the new configuration to take effect.
Whenever you modify system-level networking parameters, it is reasonable to question the security implications.
No.
It is vital to distinguish between data plane security and link layer management:
WcmSvc only controls interface associations (whether your Wi-Fi card stays connected to the local router).Setting EnableBadStateTracking to 0 does not open ports, alter route tables, bypass DNS leak protections, or weaken firewall policies. If the VPN tunnel drops unexpectedly, the WFP filters still block every non-VPN packet from leaving your machine.
The only side effect is behavioral: if you connect to a genuinely broken Wi-Fi network (for example, a hotel router that has lost its upstream fiber connection), Windows will no longer automatically drop the Wi-Fi connection in an attempt to cycle adapters. It will stay associated with the local router and simply show the "No Internet" status icon in your system tray. For development machines and controlled home/office setups, this is typically the preferred behavior.
If you ever wish to revert this setting back to stock Windows behavior, run this single command from an elevated prompt:
reg delete "HKLM\SOFTWARE\Microsoft\WcmSvc" /v EnableBadStateTracking /f
Restart your computer, and Windows Connection Manager will resume its default recovery routines.
Modern operating systems try aggressively to automate network diagnostics for general consumers. However, when you introduce privacy tools, custom WireGuard profiles, or zero-trust endpoint agents, these automated "self-healing" heuristics often turn into breaking race conditions.
By disabling bad state tracking, you stop Windows from second-guessing your network topology, allowing your local Wi-Fi link to remain steady while your VPN tunnel initializes cleanly.
WcmSvc Wi-Fi disconnect issue.WcmSvc recovery triggers and VPN conflicts.EnableBadStateTracking workaround.