Networking under WSL is solid but has a few quirks, I'd recommend confirming you can connect via Windows proper first of all, and only then troubleshoot from within WSL. As Jaka mentioned, run ipconfig
in a Windows command line/Powershell/Terminal, the command works in all of them, which will tell you the IP address Windows is assigning to the wired ethernet adapter.
If you then run ifconfig
I'll bet you get a different set of IP addresses. By default WSL runs in NAT mode and you don't actually get full access to the network. This most commonly hits when you're trying to access services hosted within WSL from different computers, but I suspect something similar is going on here too.
Other things to confirm, but I suspect you're running WSL2, what version of WSL are you using? wsl --version
in Windows Terminal will give that. WSL1 worked differently and gave more open network access by default, WSL2 however has NAT mode as standard.
Make sure you read through it and understand the caveats, but I suspect that enabling Mirrored Network Mode may help. It'll give your WSL instances access to the same network adapters that Windows has. It's not exactly user friendly to configure, but should just be a couple of commands. More info here:
https://learn.microsoft.com/en-us/windows/wsl/networking