Fix WSL2 Cannot Access Windows Host Proxy — Three Invisible Pitfalls
Encountered this issue while using AI coding tools (Claude Code, Roo) in WSL2 that need to access APIs through the Windows host proxy. After fixing the firewall, encountered two more hidden pitfalls. Documenting all root causes and solutions.
TL;DR
WSL2's vEthernet (WSL) virtual NIC is created on every launch. Windows Firewall cannot assign a Network Profile to it, so all inbound rules are ineffective (EnforcementStatus: NotApplicable). Don't add rules — disable the firewall on that interface directly:
# Run in Windows PowerShell (Administrator)
Set-NetFirewallProfile -DisabledInterfaceAliases "vEthernet (WSL)"
Additionally, after fixing the firewall, you may encounter two more pitfalls:
- Dynamic IP Issue: Host IP changes after WSL/Windows restart
- Config Cache Issue: Stale API keys in
~/.claude.jsonand~/.claude/settings.jsoncause auth conflicts