DEV Community

Yuil Tripathee
Yuil Tripathee

Posted on

Network interfacing issues faced using WSL 2 (and fixes)

#1 - Memory not releasing back

It becomes overload to the system and eventually leading to Blue Screen of Death if not treated on time.

# only termination (still VM is alive)
wsl -t kali-linux

# shutdown
wsl --shutdown kali-linux
Enter fullscreen mode Exit fullscreen mode

#2 - WSL2 network ports are virtual and cannot be accessed from LAN

# for port forwarding
netsh interface portproxy add v4tov4 listenport=8001 listenaddress=192.168.0.10 connectport=80 connectaddress=192.168.0.10

# for listing
netsh interface portproxy show all

# for cleanup
netsh interface portproxy reset

# or,
netsh interface portproxy delete

# ON and OFF
netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33

netsh interface portproxy delete v4tov4 listenport=4422 listenaddress=192.168.1.111
Enter fullscreen mode Exit fullscreen mode

You need to get Linux IP (use ip route). Check official docs for more information. Also, you can use NGINX with the following configuration:

events {}

http {
     server {

        listen 192.168.1.111:4422;

        location / {
            proxy_pass http://192.168.2.33:80/;
        }
     }
}
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay