Following this question I issued this command as an admin thorough PowerShell:
netsh interface portproxy add v4tov4 listenport=4000 listenaddress=0.0.0.0 connectport=4000 connectaddress=(wsl hostname -i)
Unfortunately, I know zero about netsh and blindly ran code I don't understand.
Now, in my alpine WSL2 I cannot apk update:
~# apk update
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
WARNING: updating https://dl-cdn.alpinelinux.org/alpine/edge/main: Permission denied
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
WARNING: updating https://dl-cdn.alpinelinux.org/alpine/edge/community: Permission denied
v20231219-2427-gd0dda5e6861 [https://dl-cdn.alpinelinux.org/alpine/edge/main]
v20231219-2427-gd0dda5e6861 [https://dl-cdn.alpinelinux.org/alpine/edge/community]
0 unavailable, 2 stale; 23217 distinct packages available
First suggestion was to, as far as I understand, reset the proxy as in this question
- This question addresses another issue not related to WSL2 and the answer is for Win8.
- I am hesitant of running
netsh winhttp reset proxyas this computer's proxy was setup by someone else and the machine needs to keep that configuration. Also, Windows itself has no problem talking to the internet. The command might reset a setting, but it will also do more that reverting only one command: it might revert even thousands of them. - Under Control Panel > Internet Options > Connections (tab) I see no connections to delete.