hi Folks,
This is my first post, please excuse any missteps.
OpenWrt 18.06.2, kernel version 4.9.152, running on TP-LINK Archer C7 v4.
I would like to implement a method to monitor/capture all wireless and wired traffic on the router, including LAN wireless-to-wireless, wired-to-wired, wireless-to-wired, as well as WAN.
Setting up a mirror with source port "CPU(eth0)" does not capture wireless-to-wireless nor wired-to-wired LAN traffic (does capture wired-to-wireless and wired/wireless to WAN).
Also tried the iptables -TEE method but that doesn't show intra-switch wireless-to-wireless traffic:
iptables -t mangle -I PREROUTING -i br-lan -j TEE -gateway 192.168.0.10
iptables -t mangle -I POSTROUTING -0 br-lan -j TEE -gateway 192.168.0.10
However if I run tcpdump directly on OpenWrt and specify the "any" or "br-lan" interfaces, I can see wireless-to-wireless LAN traffic. I am not able to observe wired-to-wired traffic, presumably because this is being handled at the switch hardware level and not being pushed back up into the router OS.
As a compromise I'd be happy with being able to capture WAN, wired-to-wireless, and wireless-to-wireless, but NOT wired-to-wired (as I can do this on a downstream switch with a mirror port).
The iptables -TEE method appeared promising, but doesn't yield the promising results that tcpdump shows. I could pipe tcpdump to a netcat listener on another computer, or SSH in from another computer and and pipe tcpdump back out of the router, but both of those methods seem more complex and brittle.
I've reviewed this similar thread which covers many of the same approaches we have tried:
Anybody else have a solution for mirroring ALL east/west (internal) traffic? Any guidance would be greatly appreciated.
sincerely,
alex