12

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?

RetAFVLib
  • 176
  • 1
  • 2
  • 13

3 Answers3

10

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\

zwxi
  • 782
  • 7
  • 9
  • 2
    I allowed both bash.exe and wsl.exe to firewall and it finally works. Thanks – Monday Fatigue May 01 '21 at 23:56
  • @MondayFatigue I've updated the answer to include wsl.exe as well. Marking it as the correct answer will help other people find a solution to the same problem faster. There should be a tick mark near the answer to mark it as the solution – zwxi May 03 '21 at 05:23
  • I would but I'm not the asker, unfortunately. – Monday Fatigue May 04 '21 at 23:02
  • 1
    @MondayFatigue lol I didn't notice that, sorry – zwxi May 05 '21 at 06:51
  • For me setting MTU didn´t help, but i found out that it was problém with VPN settings. Go to you norton 360 app, VPN settings and turn off "Automatic VPN" Maybe you will need to add wsl to your whitelist.. – Lukáš Secký Apr 03 '23 at 08:13
1

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

0

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.