Reputation: 194
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?
Upvotes: 13
Views: 27834
Reputation: 31
I did all of the above steps. I finally got it to work by setting my network from Public to Private.
Turns out Norton was adding extra security because of it. You can enable Internet Connection Sharing and it'll work instead of switching a network to Private.
Upvotes: 3
Reputation: 31
I was able to fully resolve this issue of Norton 360 blocking egress SSH traffic from WSL to remote hosts. This was resolved on Windows 11 and Norton360 V22.23.5.106. This should also work as specified on Windows 10. After installing Norton, open "Norton Anti-Virus", open "Device Security". A new window opens. At the top menu bar, select "Settings". Then select "Firewall". Under "Program Control" add bash.exe and wsl.exe as directed in this solution above by zwxi. Then, select "Traffic Rules". Add a traffic rule with the following : Action: Allow, Connections: Connect to any computer, Computers: Any computer, Communications: TCP, add remote port 22 (weird UI, select individually specified ports, then enter 22), Advanced: Apply rule for NAT traversal traffic Off.
Upvotes: 1
Reputation: 11
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
Upvotes: 1
Reputation: 840
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\
Upvotes: 12