Skip to content

Ping is not working #18

Closed
Closed

Description

Ping is not working on WSL.

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

Activity

  1. changed the title [-]ping not working[/-] [+]Ping is not working[/+] on Apr 7, 2016
  2. fhelje commented on Apr 7, 2016

    @fhelje

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

  3. gdude2002 commented on Apr 7, 2016

    @gdude2002

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

  4. patryk9200 commented on Apr 7, 2016

    @patryk9200
    Author

    fhelje Gareth Coles (@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.

  5. jolibert commented on Apr 7, 2016

    @jolibert

    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.

  6. kjk commented on Apr 7, 2016

    @kjk

    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).

  7. nanogennari commented on Apr 8, 2016

    @nanogennari

    Krzysztof Kowalczyk (@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
    
  8. eternelpanic commented on Apr 8, 2016

    @eternelpanic

    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

  9. SvenGroot commented on Apr 9, 2016

    @SvenGroot
    Member

    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.

  10. patryk9200 commented on Apr 9, 2016

    @patryk9200
    Author

    Sven Groot (@SvenGroot) Thanks for info!

  11. arjennienhuis commented on Apr 11, 2016

    @arjennienhuis

    Why is this closed?

  12. gdude2002 commented on Apr 11, 2016

    @gdude2002

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

    Is it fixed? I still get the same behaviour.

  13. sunilmut commented on Apr 11, 2016

    @sunilmut
    Member

    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

  14. arjennienhuis commented on Apr 11, 2016

    @arjennienhuis

    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'

  15. 64 remaining items

  16. karpulix commented on Apr 29, 2017

    @karpulix

    Sunil Muthuswamy (@sunilmut) Thank you! I'm update system and it problem resolved.

  17. brtmrl commented on May 31, 2017

    @brtmrl

    No need to update. Login as an administrator not as a guest.

  18. diveyez commented on Jan 12, 2018

    @diveyez

    WSL has been nothing but problems.

  19. ryanerwin commented on Jan 13, 2018

    @ryanerwin

    diveyez (@diveyez)

    ping has been working for several months, I think since the first creators update.

    WSL is still not perfect, but it's pretty impressive to me that compiled Linux binaries can use the Windows kernel in place of the Linux kernel and most of it works.

    You can always run a VM if WSL doesn't deliver what you need. I'm eager for when WSL support is complete - no bugs at all. Personally I already find it less frustrating than trying to build Linux tools to run natively on Mac OS X, and it's getting better with each release.

  20. spacemishka commented on Mar 6, 2018

    @spacemishka

    I am trying to setup WSL but getting still errors on ping

    user@nb-999:~$ ping google.de ping: unknown host google.de user@nb-999:~$ ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Invalid argument ping: sendmsg: Invalid argument

    resolv.conf:

    user@nb-999:~$ cat /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4

  21. aseering commented on Mar 6, 2018

    @aseering
    Contributor

    Hi spacemishka -- what version/build of Windows are you running? (Type ver at a Windows Command Prompt.)

    This is a common issue with older releases of Windows 10, but a fix was released via Windows Update.

  22. mivsmirnov commented on Nov 15, 2018

    @mivsmirnov

    Hi!

    Still cannot run ping even if run-as admin mode until sudo it:
    Microsoft Windows [Version 10.0.16299.726]
    msmirnov@smirnov:/mnt/c/Windows/System32$ ping www.ru
    ping: socket: Operation not permitted
    msmirnov@smirnov:/mnt/c/Windows/System32$ sudo ping www.ru
    PING www.ru (217.112.35.75) 56(84) bytes of data.
    64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=1 ttl=53 time=14.6 ms
    64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=2 ttl=53 time=15.10 ms
    64 bytes from v76-u.valuehost.ru (217.112.35.75): icmp_seq=3 ttl=53 time=14.5 ms

  23. gbminnock commented on Dec 11, 2018

    @gbminnock

    works fine as others have said when I run the Kali app as Administrator.

  24. ION28 commented on Dec 27, 2018

    @ION28

    for anyone still running into this issue, the below command fixed it for me:

    sudo chmod u+s `which ping`
  25. added a commit that references this issue on Dec 27, 2018
  26. sxpistols commented on Feb 14, 2019

    @sxpistols
    sudo chmod u+s `which ping`

    thank you, it worked for me

  27. harryqt commented on Jun 1, 2020

    @harryqt

    for anyone still running into this issue, the below command fixed it for me:

    sudo chmod u+s `which ping`

    Installed Ubuntu 20.04 on WSL 2, ran into the same issue. But that solution worked. 👍

  28. fuomag9 commented on Jun 5, 2020

    @fuomag9

    for anyone still running into this issue, the below command fixed it for me:

    sudo chmod u+s `which ping`

    Brand new windows 2004 kali wsl2 install, this fixed it for me as well, thanks!

  29. mspncp commented on Sep 7, 2020

    @mspncp

    FWIW: according to the manual page, it is sufficient to set the CAP_NET_RAW capability. The following command worked for me:

    sudo setcap cap_net_raw+ep `which ping`
    

    Whether this method is safer than 'set-uid root' or not, I can't tell.

  30. toor11 commented on Jul 6, 2021

    @toor11

    That is a permission issue:
    Before :

    user@localhost:~$ for n in {1..5}; do ping 1.1.1.1; done
    ping: socket: Operation not permitted
    ping: socket: Operation not permitted
    ping: socket: Operation not permitted
    ping: socket: Operation not permitted
    ping: socket: Operation not permitted
    

    AFTER:

    user@localhost:~$ sudo setcap cap_net_raw+p /bin/ping
    [sudo] password for user:
    user@localhost:~$ ping 1.1.1.1
    PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
    64 bytes from 1.1.1.1: icmp_seq=1 ttl=50 time=46.2 ms
    64 bytes from 1.1.1.1: icmp_seq=2 ttl=50 time=45.0 ms
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions