My firewall (Norton) is blocking WSL 2 from using the internet. I cannot ping even google.
When I turn the firewall off, everything works, and when I turn it back on again, it no longer works.
What rules do I have to set on the firewall to allow WSL to go through? Will it work for all firewalls or just Norton?
Enabling WSL2 Support in Firewall Settings Locate PowerShell in the Start menu, right-click on it and select “Run as Administrator”. Now you can select WSL2 targets in VisualGDB dialogs and they will work out-of-the-box, just like WSL1 targets.
The good news is that WSL 2 supports Linux firewall implementations like iptables that can control network traffic. For example, after installing iptables, you can use the following command to block connections to port 80 and 443.
Administrator privileges in Windows are required to run OpenSSH in WSL. To run an OpenSSH server, run your WSL distribution (ie Ubuntu) or Windows Terminal as an administrator.
Whitelist C:\Windows\System32\bash.exe
and C:\Windows\System32\wsl.exe
in every antivirus software or firewall you use.
If that doesn't work, try adding the distro_name.exe file of you installed distro. You'll find a the distro_name.exe file inside a subfolder with you distro name in C:\Program Files\WindowsApps\
My SSH it was blocked by Norton 360 in a mysterious way. But in the link below I found two temporary solutions that solves the problem to me. https://askubuntu.com/questions/1229456/ssh-fails-with-connection-timed-out-in-vpn-and-hangs-here-expecting-ssh2-msg
Setting MTU to 1200 solved it for me (Ubuntu 20.04): sudo ip li set mtu 1200 dev {dev}
or
Setting the KEX algorithm manually solves the problem.
Add KexAlgorithms ecdh-sha2-nistp521 to the corresponding SSH config, or add -oKexAlgorithms=ecdh-sha2-nistp521 to the command line args for one time use.
Reference (2019): https://superuser.com/a/1462220/555702
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With