The problem is when I enable this setting in my firewall.
I can't connect to internet from my WSL.
I have tried to allow connection to WSL using this guide microsoft/WSL#4585 (comment).
But still, the problem still persist. 😔
I assume that the port forwarding used by WSL interface is corrupted by Hyper-V that I just installed not so long ago. So, I disabled my Hyper-V via "Turn Windows Features On or Off" and then reboot my system.
Sadly, It still not working. I hope that Hyper-V could reset my WSL network Interface but it doesn't do it. It left the WSL network interface just the way it is.
So, I need the way to reconfigured my WSL network interface. I figured out that I should completely refresh install my WSL to readjust the network interface.
So, I follow this tutorial: 1
wsl --export $DISTRIBUTION_NAME $PATH_TO_SAVE_FILE.tar
From Apps & Features
(a.k.a. Add or remove programs
) in Windows, remove all of the Windows Subsystem for Linux Update
. In my Windows there are 3 updates, so I remove them all.
From Turn Windows Features on or off
, disable this feature to remove completely WSL:
Windows Subsystem for Linux
Virtual Machine Platform
Then, reboot your Windows.
After reboot, reenable those 2 features again. This will perform a clean install of WSL freshly to your Windows just like out of the box.
The networking in WSL should work normally again.
Beware of Hyper-V, you should choose one whether you want to use WSL and WSA or in the other hand Hyper-V. I prefer to use WSL and WSA instead of Hyper-V. So, I remove Hyper-V feature from my Windows.
Footnotes
-
NotTheDr01ds, “Answer to ‘Completely reinstall WSL,’” Super User. Accessed: Dec. 24, 2023. [Online]. Available: https://superuser.com/a/1619435 ↩