Timeline
Timeline
2025-10-03
init
This article introduces the issue where WSL2 Archlinux mirror network mode may fail to access the network after a restart under Win11, and summarizes how to distinguish DNS and firewall faults by checking gateway connectivity, thereby providing specific solutions such as disabling automatic DNS generation, allowing wsl.exe firewall permissions, and switching network modes.
Under the Mirrored network mode of Win11 + WSL2 archlinux, there is a probability that the issue of WSL being unable to access the network while Windows can will be triggered after a restart.

wsl configuration
1 | [wsl2] |
ping gateway
First confirm whether you can ping the gateway.
- If you can ping the IP but cannot access the domain name → it is a DNS issue
- If you cannot even ping the IP → it is a network forwarding / network card / firewall issue
1 | ping -c 4 8.8.8.8 |
DNS issue
1 | sudo emacs /etc/resolv.conf |
To avoid being overwritten on every restart, you can disable automatic generation
1 | sudo bash -c "echo '[network]' > /etc/wsl.conf" |
Restart WSL
1 | wsl --shutdown |
Check if the network is restored
Firewall issue
Open Firewall and network protection in Windows Security Center:
Click Allow an app through firewall and add C:\Windows\System32\wsl.exe.
Check again if the network is restored.
Others
If the following error occurs:
1 | wsl: 出现了内部错误。 |
- You can try restarting
1 | wsl --shutdown |
- Try updating WSL and retry
1 | wsl --update |
Or first switch to NAT mode in WSL Settings, then after successfully opening WSL, switch back to Mirrored mode
If automatic DNS generation is turned off, try turning it on and setting it up
/etc/wsl.confin thegenerateResolvConf = true
