WSL icon indicating copy to clipboard operation
WSL copied to clipboard

tcpflow does not work in bash

Open xplicit opened this issue 9 years ago • 13 comments

  • A brief description

While ifconfig was fixed in latest insider preview, tcpflow still does not work. Trying to run sudo tcpflow -i lo port 20000 shows error: tcpflow: lo: socket: Invalid argument

  • Expected results it should start to listen tcp traffic on port 20000

  • Actual results (with terminal output if applicable) tcpflow: lo: socket: Invalid argument

  • Your Windows build number version 1607 build 14986.1000

  • Steps / All commands required to reproduce the error from a brand new installation Run bash as administrator, then type: sudo tcpflow -i lo port 20000

  • Strace of the failing command

socket(PF_PACKET, SOCK_RAW, 768)        = -1 EAFNOSUPPORT (Address family not supported by protocol)
socket(PF_INET, SOCK_PACKET, 0x300 /* IPPROTO_??? */) = -1 EINVAL (Invalid argument)
write(2, "tcpflow: ", 9tcpflow: )                = 9
write(2, "lo: socket: Invalid argument", 28lo: socket: Invalid argument) = 28
write(2, "\n", 1
  • Required packages and commands to install tcpflow

See our contributing instructions for assistance.

xplicit avatar Dec 17 '16 01:12 xplicit

Does it work on the non-loopback ifaces?

fpqc avatar Dec 17 '16 01:12 fpqc

@fpqc it does not work on all interfaces (I tried sudo tcpflow -i eth1 port 20000 and sudo tcpflow -i any port 20000)

xplicit avatar Dec 17 '16 02:12 xplicit

This sounds related to @JasonLinMS 's final comment on #1451 , regarding SOCK_RAW support.

aseering avatar Dec 17 '16 02:12 aseering

@sunilmut Yeah, unfortunately, we don't support SOCK_PACKET yet either.

JasonLinMS avatar Dec 17 '16 02:12 JasonLinMS

Why ppl like Linux because Linux has fewer restrictions, people can do more what they want to do. Please don't bring the limit from windows to the WSL.if only can do the windows can do,why we should be use WSL?

Soo,when could be the problem soloved?

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/17817685-support-af-packet-address-family-tcpdump-wireshar

that has 1426 votes now ? how many votes need ?

sgf avatar Oct 12 '18 11:10 sgf

More than a year later and still no progress? Seriously, what is it going to take to prioritize supporting AF_PACKET and RAW SOCKETS.

hackdefendr avatar Oct 13 '18 16:10 hackdefendr

Dunno. I do know what it is going to take to dupe this into #1349 though.

therealkenc avatar Oct 13 '18 22:10 therealkenc

Is there any update to this issue? I'm unable to run any network related programs other than ping or curl really...

Blizzardo1 avatar May 03 '19 09:05 Blizzardo1

Is there still no fix for the missing compatibility with AF_SOCKET etc.?

nubix avatar Aug 20 '19 13:08 nubix

Is there still no fix for the missing compatibility with AF_SOCKET etc.?

AF_PACKET (and much else) is available in WSL2.

therealkenc avatar Aug 27 '19 18:08 therealkenc

image

therealkenc avatar Jul 09 '20 10:07 therealkenc

image

therealkenc avatar Jul 30 '20 08:07 therealkenc

Just a note: for me the reason of trying to use tcpflow in WSL was the ability to launch server in Windows and use tcpflow to capture traffic from Windows. Unfortunately in WSL2 it's still impossible.

xplicit avatar Jul 30 '20 10:07 xplicit