在 %USERPROFILE%\\.wslconfig 中添加以下内容
%USERPROFILE%\\.wslconfig
[wsl2] networkingMode=mirrored dnsTunneling=true firewall=true autoProxy=true
然后终端执行 wsl --shutdown
wsl --shutdown
Advanced settings configuration in WSL
https://github.com/microsoft/WSL/issues/10753