WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Ping is not working

Open patryk9200 opened this issue 10 years ago • 79 comments

Ping is not working on WSL.

When used, returns: # ping google.com ping: icmp open socket: Socket type not supported

patryk9200 avatar Apr 07 '16 09:04 patryk9200

Have the same issue network doesn't work, running windows in parallels on a mac

fhelje avatar Apr 07 '16 09:04 fhelje

I got networking working on mine by disabling my AV's firewall, but it doesn't fix ping.

gdude2002 avatar Apr 07 '16 09:04 gdude2002

@fhelje @gdude2002 For me network is working, I can sucessfully download content from internet for example: wget google.com but what is not working is ping command and some other network related stuff.

patryk9200 avatar Apr 07 '16 12:04 patryk9200

I confirm that requests out of a normal, SYN/SYN-ACK/ACK TCP connection (transport -UDP- and network -ICMP even locally- layers on ISO model) are not working. Normally it is looking good to disallow communications at the network level and below, but for internal developments, it should be considered as back-end business related.

jolibert avatar Apr 07 '16 12:04 jolibert

Same issue when using 14316 in latest Parallels on latest Mac OS X.

Inside bash, network doesn't seem to work. DNS resolution fails, ping a fixed address doesn't work:

root@localhost:~# ping google.com
ping: unknown host google.com
root@localhost:~# ping 8.8.8.8
ping: icmp open socket: Socket type not supported

The same commands work inside cmd.exe.

This means that apt-get doesn't work so I can't install any additional packages.

I tried both "Shared Network" and "Bridged Network" networking modes of Parallels.

It might be deficiency of (or incompatibility with) Parallel's network driver.

Happy to provide more info from within bash (given that network stack is probably emulated in WSK I wouldn't know what behavior standard linux network debugging techniques is buggy but expected vs. unexpectedly buggy).

kjk avatar Apr 07 '16 23:04 kjk

@kjk It loos like there are two different issues, one is with DNS resolutions, and it is easily solved, just add a DNS server to /etc/resov.conf, it shoud look like:

root@localhost:/# cat /etc/resolv.conf
nameserver 10.10.10.1

After that apt-get shoud work.

The second issue is with ping, i'm having the same problem here:

root@localhost:/# ping 10.10.10.1
ping: icmp open socket: Socket type not supported

nanogennari avatar Apr 08 '16 04:04 nanogennari

Traceroute is no better: root@localhost:~# traceroute www.internode.on.net traceroute to www.internode.on.net (150.101.140.197), 30 hops max, 60 byte packets setsockopt IP_MTU_DISCOVER: Invalid argument

eternelpanic avatar Apr 08 '16 07:04 eternelpanic

ICMP is currently not supported, which is why "ping" fails. We realize that this makes it inconvenient to diagnose possible networking issues, and are working to address this.

SvenGroot avatar Apr 09 '16 00:04 SvenGroot

@SvenGroot Thanks for info!

patryk9200 avatar Apr 09 '16 12:04 patryk9200

Why is this closed?

arjennienhuis avatar Apr 11 '16 21:04 arjennienhuis

..huh, I didn't get an email for this.

Is it fixed? I still get the same behaviour.

gdude2002 avatar Apr 11 '16 21:04 gdude2002

Yes, any network tools that rely on NETLINK or ICMP do not currently work and we are aware of this. We will be tracking\prioritizing which features to light up next by looking at the feedback provided at the wpdev portal. We appreciate your feedback and please make sure to provide it through the wpdev portal as well. Looks like there is already a post tracking this which you can up vote (or add a new one):

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13383789-enable-network-interface-enumeraration

sunilmut avatar Apr 11 '16 22:04 sunilmut

Closing the issue is still a bad idea and also a bit rude.

A nicer way is to tag it as 'wishlist', 'feature' or even 'backlog'

arjennienhuis avatar Apr 11 '16 23:04 arjennienhuis

Not only is closing the issue a bad idea, referencing a feedback post that has a description completely unrelated to this issue is really bad.

No one viewing that feedback post will think it relates to this issue.

fungus avatar Apr 12 '16 22:04 fungus

@arjennienhuis, @fungus - Feedback taken regarding closing the issue. I will keep this in mind going forward.

sunilmut avatar Apr 12 '16 22:04 sunilmut

I have multiple networking tools that I cannot use due to this bug effecting ping, dig and anything raw socket related. Please address and prioritize this bug since Linux networking is a core feature of Linux and this bug probably spans thousands of Linux packages.

ion-storm avatar Apr 17 '16 01:04 ion-storm

My bash can connect to the internet fine and DNS works however I get the same problem with ping and traceroute. Traceroute - 'setsockopt IP_MTU_DISCOVER: Invalid argument' Ping - 'ping: icmp open socket: Socket type not supported' arp-scan - 'link_open: Address family not supported by protocol'

williambargentball avatar May 26 '16 10:05 williambargentball

@williambargent - ping has been enabled for admin prompts, but hasn't made it to the release branch yet. As for the other network utilities, that's something that we are aware of, but haven't had a chance to enable them yet. You can help us prioritize this work for the future by providing your feedback through our User Voice page or up voting this relevant request. And, thanks for trying out WSL!

sunilmut avatar May 26 '16 17:05 sunilmut

Ping works if you run Bash in an admin console as of 14352. It is not ideal but is the best we will be able to get it for the Anniversary Edition. If you try running in a non Admin console you should get a permission denied message.

As @sunilmut points out, please keep adding / up voting on the User Voice page. We really do look at those when determining priorities.

russalex avatar May 26 '16 22:05 russalex

Regarding the requirement for admin for ping, that is something we (WSL) have inherited from the Windows TCP/IP stack which requires admin privileges to open RAW sockets for security measures. See this MSDN post for more details.

sunilmut avatar May 26 '16 23:05 sunilmut