Tcpdump stops capturing wifi data while running in the background

I have a problem capturing wifi data using tcpdump while running in the background.

OK, lets get some facts:

  • my wifi-device is named wlan0
  • wlan0 is in monitor mode (that’s what I want)
  • I’m using tcpdump to capture packets

If I run my script manually in the shell, it works well. Now I want to capture all packets over a long period. I decided to put my script into /etc/rc.local which is executed at the system-start.

It looks like this:

tcpdump -l -i wlan0 | do_some_action.sh >/dev/null 2>&1

After a reboot I can see that all the data captured is being forwarded to my script. So far – so good.

30-60 minutes later no data is captured anymore. tcpdump is still running, but wlan0 seems to be gone sleeping.

I have to ifdown / ifup wlan0 to get some traffic again.

Could anybody explain whats going on here and how to fix this problem?

Answer

Attribution
Source : Link , Question Author : Mitch , Answer Author : Community

Leave a Comment