Ethernet in promiscuous mode

I’m trying to use the Ethernet ports of my Banana Pi BPI-R2 in promiscuous mode to receive frames that are not destined for a MAC address that is not assigned to any of the five ports and also not a mulitcast address. I am using a Linux 4.14 kernel (based on https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:kernel), so I actually have 6 interfaces show up (eth0, lan0-lan3@eth0 and wan@eth0). I’ve tried setting eth0 and/or the lan0-3 explicitly to promiscuous (using ip command), writing my own raw socket application as well as using standard tools like ‘tcpdump’. Wireshark/tcpdump on the other machine sending the frame definitively show an outgoing frame, and if the frame is destined to the “correct” MAC, it does show up on the tcpdump running on the R2. However, if I send a frame to another MAC, I get no traffic in userspace despite my various attempts to enable promiscuous mode.

Any suggestions? I really need to get promiscuous mode working, as I must use the BPI as a switch and not as a router.

Maybe it’s me, but if you want to use it as switch why don’t you just put all the ports in a bridge?

I want my students to implement a (v)switch in software in userspace to learn how a switch works.

I try the “tcpdump” command on my kernel 4.4 device, whose Ethernet + DSA drivers are port back from native kernel 4.14. The “tcpdump -i lan0 -xxx” can see the frame destined to the “other host” MAC. Note that the “tcpdump” command also set lan0 into promiscuous mode.

I’ve done some further diagnostics, and the issue ONLY applies to ARP packets. IP packets to a different MAC are transmitted correctly, but ARP packets are not delivered to userspace even in promiscuous mode.