Issues with ifconfig, sockets, nmap, ping, nslookup, dig and others not working
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
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.
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
so when this problem can be solved?
@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.
This issue is causing issues with libzmq and other socket libraries.
Related issue is #134
any update on this? network is a rather big point and should work
A lot has changed since this ticket was last updated. It's probably be worth re-testing the specific issues reported here.
I just fresh installed 4 days ago and it acts the same.
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?
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.
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]
i'm currently on Windows 10 Insider Preview 14390 - and i've got the same issues as in https://github.com/Microsoft/BashOnWindows/issues/69#issuecomment-233204632
14394 - still not working properly, traceroute does not work
Any update on this?
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.
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
@DennisSc - Yes, we are aware of the pain of not having some of these networking tools enabled on WSL and are looking into it. Please also help us prioritize by upvoting the [user voice page for this feature](Here is the user voice page for supporting iptables, ifconfig and others! https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/15202875-would-you-like-to-support-ifconfig-iw-iwconfig-t)
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/15202875-would-you-like-to-support-ifconfig-iw-iwconfig-t
No connectivity from Bash to internet?
root@xxxx:~# ifconfig Warning: cannot open /proc/net/dev (No such file or directory). Limited output. root@xxxx:~# ping www.google.com ping: icmp open socket: Permission denied root@xxxx:~# ip r SO_SNDBUF: Invalid argument root@xxxx:~# cat /etc/hosts 127.0.0.1 localhost
The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts root@xxxx:~# cat /etc/resolv.conf
DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1 nameserver 172.18.11.1 nameserver 192.168.1.1
After Reinstall Windows 10’s Ubuntu Bash Shell
lxrun /uninstall /full lxrun /install /y
Now “root” Account as the default user account . What ?
Additional Information Antivirus - Details
Norton Security Version: 22.7.0.76
@Honey0cool You shouldn't run lxrun /install as administrator, that's what causes "root" to be the default account.