Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with ifconfig, sockets, nmap, ping, nslookup, dig and others not working #69

Closed
javydekoning opened this issue Apr 8, 2016 · 101 comments

Comments

@javydekoning
Copy link

nmap:

root@localhost:/mnt/c/users/jdekoning# nmap google.com

Starting Nmap 6.40 ( http://nmap.org ) at 2016-04-08 12:37 UTC
route_dst_netlink: cannot create AF_NETLINK socket: Invalid argument

Ping:

root@localhost:/mnt/c/users/jdekoning# ping google.com
ping: icmp open socket: Socket type not supported

nslookup:

root@localhost:/mnt/c/users/jdekoning# nslookup google.com
socket.c:2447: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.142.23.200#53: Invalid argument
socket.c:2447: setsockopt(21, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.141.23.200#53: Invalid argument
socket.c:2447: setsockopt(22, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 10.130.23.100#53: Invalid argument

traceroute:

root@localhost:/mnt/c/users/jdekoning# traceroute 8.8.4.4
traceroute to 8.8.4.4 (8.8.4.4), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument

DIG:

root@localhost:/mnt/c/users/jdekoning# dig @8.8.4.4 google.com
socket.c:2447: setsockopt(20, SO_TIMESTAMP) failed: Invalid argument
socket.c:1915: internal_send: 8.8.4.4#53: Invalid argument

@javydekoning javydekoning changed the title Issues with socket.c nmap,ping and nslookup not working. Apr 8, 2016
@Aneurin
Copy link

Aneurin commented Apr 8, 2016

All of the ones which produce "socket.c: 1915: internal_send ..." are BIND tools that don't seem to work here. You can install the Knot DNS equivalents which do, using apt-get install knot-host knot-dnsutils, to get working dig and host at least, though it doesn't seem like there's a Knot nslookup.

For the rest, it looks like only certain types of sockets can be created. Maybe raw sockets aren't permitted so we can only open TCP and UDP sockets? You would at least expect ICMP to be available though.

@sunilmut
Copy link
Member

Yes, NETLINK sockets are currently not implemented. ICMP is also currently not supported. UDP and TCP sockets should work fine though. 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 sunilmut reopened this Apr 18, 2016
@nianyush
Copy link

so when this problem can be solved?

@sunilmut
Copy link
Member

@xiaoyu9964 Thanks for your patience and we understand that not having basic network tools working, can be frustrating. That being said, support for RAW/ICMPv4 sockets are being checked in our development branch. That should unblock ping. ping6 still doesn't work. We are working to unblock these scenarios as well in future. Meanwhile, please help us prioritize this by up voting this specific request in the User Voice page. Thanks again for trying WSL and providing feedback.

@MadcowD
Copy link

MadcowD commented May 1, 2016

This issue is causing issues with libzmq and other socket libraries.

Related issue is #134

@Deshke
Copy link

Deshke commented Jul 17, 2016

any update on this? network is a rather big point and should work

@aseering
Copy link
Contributor

A lot has changed since this ticket was last updated. It's probably be worth re-testing the specific issues reported here.

@ldanicel
Copy link

I just fresh installed 4 days ago and it acts the same.

@aseering
Copy link
Contributor

This issue is actually an aggregation of a bunch of bugs, some of which are known to be fixed. Could you please include your specific Windows build and which of the issues on this ticket you tested?

@aseering
Copy link
Contributor

In particular, off the top of my head, ping is #18 and libzmq is #185.

Note that both are fixed with caveats; more details are available on those tickets.

@ldanicel
Copy link

ldanicel commented Jul 17, 2016

traceroute, mtr, ifconfig, ip, route, tcpdump, nmap are not functioning at all
`
root@CASH:~# mtr google.com
mtr: unable to get raw sockets.

root@CASH:~# traceroute google.com
traceroute to google.com (82.76.231.39), 30 hops max, 60 byte packets
setsockopt IP_MTU_DISCOVER: Invalid argument

root@CASH:~# nmap -O google.com
Starting Nmap 6.40 ( http://nmap.org ) at 2016-07-18 00:13 DST
route_dst_netlink: cannot bind AF_NETLINK socket: Invalid argument

root@CASH:~# route -n
/proc/net/route: No such file or directory
INET (IPv4) not configured in this system.

root@CASH:~# ip addr show
SO_SNDBUF: Invalid argument

root@CASH:~# tcpdump
tcpdump: getifaddrs: Invalid argument

`

ping looks to be ok but still has some spookie latencies reported, like:

ping google.com
PING google.com (82.76.231.25) 56(84) bytes of data.
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=1 ttl=61 time=0.518 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=2 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=3 ttl=61 time=2.52 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=4 ttl=61 time=2.36 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=5 ttl=61 time=2.00 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=6 ttl=61 time=2.50 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=7 ttl=61 time=2.53 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=8 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=9 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=10 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=11 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=12 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=13 ttl=61 time=0.000 ms
64 bytes from 82-76-231-25.rdsnet.ro (82.76.231.25): icmp_seq=14 ttl=61 time=2.41 ms

windows build is Microsoft Windows [Version 10.0.14388]

@Deshke
Copy link

Deshke commented Jul 18, 2016

i'm currently on Windows 10 Insider Preview 14390 - and i've got the same issues as in #69 (comment)

@Skalin
Copy link

Skalin commented Jul 28, 2016

14394 - still not working properly, traceroute does not work

@vnodecg
Copy link

vnodecg commented Aug 4, 2016

Any update on this?

@CharlieEriksen
Copy link

When you started Bash with administrative privileges, not sudo, and nmap 192.168.1.1, you get this error instead:

Starting Nmap 6.40 ( http://nmap.org ) at 2016-08-04 19:39 DST
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
NSOCK ERROR [1.1340s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #1): Invalid argument (22)
NSOCK ERROR [1.1340s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #2): Invalid argument (22)
NSOCK ERROR [1.1350s] mksock_bind_device(): Setting of SO_BINDTODEVICE failed (IOD #3): Invalid argument (22)
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
Problem binding to interface , errno: 22
socket_bindtodevice: Invalid argument
Problem binding to interface , errno: 22

Ping works when you run it with administrative privileges.

@DennisSc
Copy link

DennisSc commented Aug 5, 2016

inetutils-traceroute gives the following error:
traceroute: setsockopt: invalid argument

ping works now, and name resolution too (I added 127.0.0.1 mywindowspcname. to /etc/hosts, don't know if this helps but it remedied the error "host not found" when issuing pings to IP addresses I think)

Lokks like things are still under construction...

edit - "arp" command doesn't work neither

@nakedgoat
Copy link

nmap has some errors and arp fails w/no such f/d on my windows box at home; however everything else works ping, dig, nslookup & ifconfig, on my work computer ALSO windows 10 also running bash as an admin (only real difference is work computer is on a domain via vpn) @ work non of said commands work for me.. i've updated/upgraded both systems no real changes to much .. anyway hope this might help let me know if details are needed - even tho tread is closed :)

@adamfortuno
Copy link

tcptraceroute doesn't work either.

tcptraceroute 10.140.103.197 3389

If I'm root, the error I get reads as follows:

error opening device eth2: eth2: socket: Invalid argument

If I'm not root, the error I get reads as follows:

error opening device wifi0: wifi0: socket: Invalid argument

I'm running the following version of tcptraceroute:

tcptraceroute 1.5beta7
Copyright (c) 2001-2006 Michael C. Toren <mct@toren.net>
Updates are available from http://michael.toren.net/code/tcptraceroute/
@ricardoboss
Copy link

When will this be fixed?

@abdilahrf
Copy link

2019 and still not fixed 👍

@jeyawn
Copy link

jeyawn commented Apr 6, 2019

when can i use tcpdump?

@Tommasov
Copy link

Tommasov commented Apr 8, 2019

Guys, this is not the right attitude! The missing features will be available when ready (if possible..) you should be thankful to the wls dev team for the great job done so far.

@nakedgoat
Copy link

nakedgoat commented Apr 9, 2019 via email

@Tommasov
Copy link

Tommasov commented Apr 10, 2019

Asking for features like we're in a restaurant... btw that was only my point of view. Peace

@Bruce-YC
Copy link

Have beening waiting for more than two years... Solution: Installed dual boot Arch last year 😂

@ipruthi
Copy link

ipruthi commented Jul 21, 2019

Wow, just came across this while trying to traceroute a host. It's been 3 years now 👎

@Karlheinzniebuhr
Copy link

Any updates?

@fordan
Copy link

fordan commented Aug 10, 2019

This issue has been closed since Nov 2017. The fix is to use WSL2 which has a Linux kernel and full system call functionality, although you need to be using Windows 10 build 18917 or higher which as of this date means a Windows Insider build (and opting in to the "skip ahead").

@fjleon1980
Copy link

ping is not working on 1809. this is embarrassing. why can't you fix something so basic?

@mr-ytseng
Copy link

It's not done yet 2020....

@RuiGuilherme
Copy link

RuiGuilherme commented Feb 5, 2020

1909 - 18363.628 | (2020-02-05) same issue.

~ mtr 1.1.1.1

Failure to open IPv4 sockets: Permission denied
Failure to open IPv6 sockets: Permission denied
mtr: Failure to start mtr-packet: Invalid argument 

~ ping 1.1.1.1
ping: socket: Operation not permitted

~ tcptraceroute 1.1.1.1
libnet_init() failed: libnet_open_raw4(): SOCK_RAW allocation failed: Permission denied

~ nmap 192.168.0.151

Starting Nmap 7.70 ( https://nmap.org ) at 2020-02-05 13:19 -02
Problem binding to interface , errno: 92 
socket_bindtodevice: Protocol not available
Problem binding to interface , errno: 92
@Tommasov
Copy link

Tommasov commented Feb 5, 2020

1909 - 18363.628 | (2020-02-05) same issue.
~ mtr 1.1.1.1
Failure to open IPv4 sockets: Permission denied
Failure to open IPv6 sockets: Permission denied
mtr: Failure to start mtr-packet: Invalid argument

~ ping 1.1.1.1
ping: socket: Operation not permitted
~ tcptraceroute 1.1.1.1
libnet_init() failed: libnet_open_raw4(): SOCK_RAW allocation failed: Permission denied
~ nmap 192.168.0.151
Starting Nmap 7.70 ( https://nmap.org ) at 2020-02-05 13:19 -02
Problem binding to interface , errno: 92
socket_bindtodevice: Protocol not available
Problem binding to interface , errno: 92

mtr and nmap needs administrator privileges, open bash as admin and you can use them.
Ping should work even if the terminal is not elevated

@otcamargo
Copy link

I was having these problems on my debian distro when trying to ping any ip and when installing gems respectively:

ping: socket: Operation not permitted
Failure to open IPv4 sockets: Permission denied
Failure to open IPv6 sockets: Permission denied

This solution worked for me:

https://stackoverflow.com/questions/49800432/gem-cannot-access-rubygems-org/50349235#50349235

@rebcesp
Copy link

rebcesp commented Mar 19, 2020

yet not fixed, march 2020

@dlakatos847
Copy link

dlakatos847 commented May 12, 2020

WSL is just as it sounds: too good to be true. On OpenSuSE Leap 15.1, WSL2 root shell:

# mtr 1.1.1.1
Failure to open IPv4 sockets: Permission denied
Failure to open IPv6 sockets: Permission denied
mtr: Failure to start mtr-packet: Invalid argument

Why is this issue closed?

@fordan
Copy link

fordan commented May 12, 2020

WSL is just as it sounds: too good to be true. On OpenSuSE Leap 15.1, WSL2 root shell:

Works for me under Ubuntu. I also just downloaded OpenSuSE Leap 15.1, changed it to WSL 2 and it worked fine for me as root. May want to do a wsl -l -v to verify your distro is set to use version 2.

@bitcrazed
Copy link
Contributor

@dlakatos847 - from a Windows PowerShell / Cmd, could you run wsl -l -v?

I have a feeling your openSUSE may be running on WSL1

@dlakatos847
Copy link

@dlakatos847 - from a Windows PowerShell / Cmd, could you run wsl -l -v?

I have a feeling your openSUSE may be running on WSL1

@bitcrazed You may be right, since the help is shown for wsl -l -v. Am I correct that Windows 10 2004 will bring WSL2 and a fix for this problem at the end of this month?

@dlakatos847
Copy link

I stand corrected, I unintentionally used WSL1. Windows Insider program, Windows Update and upgrading my Linux distro to WSL2 solved the problem. Thank you!

@bitcrazed
Copy link
Contributor

As per the most passionately requests from the Linux community, we avoid automatically affecting your distros and apps - we don't upgrade your WSL distro instances, nor the binaries within them, and we do not auto-upgrade your WSL1 distros to WSL2 - that's something we leave to the user to perform via wsl.exe.

This MAY change in the future when WSL2 is provides >100% of WSL1's capabilities, but for now, while WSL1 and WSL2 have some different capabilities and behaviors, we leave it to you.

@bitcrazed
Copy link
Contributor

image

POLITE NOTE - please note that this issue is closed: if you have further issues with networking tech on WSL, please file a new issue with specific details about the issue you're seeing. Thanks.

@Hayvi
Copy link

Hayvi commented Sep 24, 2020

yet not fixed, September 2020

@bitcrazed
Copy link
Contributor

@ghzwael Please note that, as stated, this issue is closed.

We recommend that you adopt WSL2 (and convert any existing distro installations to WSL instances) which will provide you with much more compatibility and near-native performance.

@treysis
Copy link

treysis commented Jun 15, 2021

@bitcrazed Is this a joke? IPv6 still not really working in WSL2...so, to use networking tools, I should upgrade to WSL2 which breaks networking all together? That's no solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment