In Windows 11 24H2 (64 bit), Windows Firewall is configured to block arbitrary Outbound Connections. That said, any program who wants to access the Internet must be specifically added to the Firewall’s Outbound rules.
In WSL v2.5.10.0, with mirrored networking mode, execute command wget https://www.google.com. Receive:
Resolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.google.com’
More info:
- In WSL:
$cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
- In Windows 11:
ipconfig /all
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Qualcomm Atheros AR8161 PCI-E Gigabit Ethernet Controller (NDIS 6.30)
Physical Address. . . . . . . . . : [...]
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.178.19(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.178.1
DNS Servers . . . . . . . . . . . : 8.8.8.8
8.8.4.4
NetBIOS over Tcpip. . . . . . . . : Enabled
In the Windows Firewall, those processes are allowed to have Outbound Connections:
C:Program FilesWSLwsl.exeC:WindowsSystem32wsl.exeC:Program FilesWSLwslhost.exeC:WindowsSystem32lxsswslhost.exeC:Program FilesWSLwslrelay.exeC:Program FilesWSLwslservice.exe
How to solve this issue?
The only workaround is to just configure the Windows Firewall to allow arbitrary Outbound Connections (unless otherwise), which I don’t want!