Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files

Maria Sophia <[email protected]> Sat, 18 Jul 2026 17:10:29 -0400
Newsgroups alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <[email protected]>
Maria Sophia wrote:
> I'm in the process of more gracefully removing IPv6, but the 
> warning here is that we need a better method of building a 
> killswitch since Windows tries to repair the route aggressively
> the instant we completely remove IPv6 from Windows networking.

Yikes! A lesson in IPv6 networking was just learned (the hard way)...

Recovering from wiping out IPv6 completely was/is a bch.
But if anyone needs it, this is how to partially wipe it out.
(Wiping it out is easy, but recovering from that act is the bch.)

This is too aggressive as it causes 
 reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 0xFF /f

This is the goldilocks IPv6 setting, apparently:
 reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0x20 /f

Unfortunately, wiping out the network adapter & re-installing
drivers means too much changed to recover from just running.
  netsh interface ipv6 set teredo default
  reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 0 /f
   Reset the TCP/IP stack
    netsh int ip reset
   Reset the IPv6 stack
    netsh int ipv6 reset 
   ID the exact name and hardware ID of the Wi-Fi adapter.
    pnputil /enum-devices /class Net
     Instance ID:
     PCI\VEN_168C&DEV_002A&SUBSYS_1000168C&REV_01\4&1a388ce3&0&0038
     Device Description:
     Qualcomm Atheros 802.11 a|b|g|n Dualband Wireless Network Module
     Driver Name:
     netathrx.inf
   ID the driver package name.
    pnputil /enum-drivers
     Qualcomm Atheros 802.11 a|b|g|n Dualband Wireless Network Module  
     Driver Name: netathrx.inf  
     Instance ID:
     PCI\VEN_168C&DEV_002A&SUBSYS_1000168C&REV_01\4&1a388ce3&0&0038
   Disable the Wi-Fi adapter 
    Get-PnpDevice -InstanceId "PCI\VEN_168C&DEV_002A&SUBSYS_1000168C&REV_01\4&1a388ce3&0&0038" | Disable-PnpDevice -Confirm:$false
   Uninstall the Wi-Fi adapter 
    pnputil /remove-device "PCI\VEN_168C&DEV_002A&SUBSYS_1000168C&REV_01\4&1a388ce3&0&0038"
   Delete the Wi-Fi driver package
    pnputil /delete-driver netathrx.inf /uninstall /force
   Reboot Windows will reinstall the NIC with fresh IPv6 metadata.
    shutdown /r /t 0

The problem is the whole system state has changed out from under me.

After re-recovering from DisabledComponents 0xFF, I now have
 a. persistent DHCP gateways
 b. DHCP Client auto-repair behavior
 c. NCSI connectivity healing
 d. auto-metric recalculation
 e. VirtualBox route normalization
 f. IPv6-triggered repair state
 g. stored gateway metadata
 h. interface "smart Wi-Fi" auto-gateway restoration

Which I found using the following debug commands:
 reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces /s | find "DefaultGateway"
    DhcpDefaultGateway    REG_MULTI_SZ    192.168.1.1
    DhcpDefaultGateway    REG_MULTI_SZ    192.168.28.35
    DhcpDefaultGateway    REG_MULTI_SZ    192.168.1.1
 sc query Dhcp
 sc qc Dhcp
    DHCP Client service is running and auto-started
    STATE: RUNNING
    START_TYPE: AUTO_START
 sc query NlaSvc
    NCSI STATE: RUNNING
 Get-NetIPInterface | sort-object InterfaceMetric
    Wi-Fi IPv4 InterfaceMetric 50
    OpenVPN Wintun IPv4 InterfaceMetric 5
    OpenVPN DCO IPv4 InterfaceMetric 25
 wmic nic get name, index
 sc query openvpnservice

Before the IPv6 mistake the PC was in a clean static mode
 a. No DHCP metadata.
 b. No NCSI repair.
 c. No persistent gateways.
 d. No auto-gateway restoration.
But after recovering from the IPv6 mistakes, the PC is
in a draconian connectivity-repair mode where I will be
 a. Removing persistent gateways
 b. Disabling the DHCP client
 c. Disabling NCSI
 d. Again raising the Wi-Fi metric
 e. Neutralizing the VirtualBox interference
And then I can re-apply the two commands from yesterday
 netsh interface ipv4 set address name="Wi-Fi 2" static 192.168.1.20 255.255.255.0 none
 netsh interface ipv4 set interface "Wi-Fi 2" metric=9999
-- 
Sometimes I wish I knew what would happen before I mess with things