M HYPE SPLASH
// updates

netstat not showing any process running on any port in WSL Ubuntu in Windows 10

By Andrew Adams

I have set up a nodejs server on 8080 port. When I put this command in the WSL Ubuntu terminal, it shows no results:

netstat -a | grep :8080

However, when I check this using Windows PowerShell command to see if this port is listening, it works:

enter image description here

Is it normal or there is something wrong?

PS: I need to know this because I can't access my server from any different network using the public IP even when port forwarding is done. I can access it only using my private IP and on same network/LAN.

So I am thinking maybe because the WSL doesn't show it as running, maybe that could be the reason.

3

1 Answer

WSL doesn't seem to have good support for commands like ss or netstat. The solution provided is to run the related Windows binary instead.

But the reason why you don't see the port listed is because netstat try to be friendly by changing the port number to a name (in this case 8080 to http-alt). Try instead:

netstat -a --numeric-ports | grep :8080

On a real Linux setup I would instead use ss -plt src :8080, to show all TCP sockets listening on the local 8080 port, alongside with processes connected. ss is included in iproute2 package and is the substitute of netstat.

To avoid the hassle of forwarding ports you could also try tunneling alternatives. A popular open source one is frp. With cloudlfare tunnel would be cloudflared tunnel --url .

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy