2021-07-14 05:27 AM
Hi
I want to use Promiscuous Mode with LWIP+STM32H743.
I want to be able to capture frames not sent over to my IP address.
Is it possible?
Thanks
Solved! Go to Solution.
2021-07-21 02:29 AM
Yes, you have to use a hub, or a managed switch with properly configured port forwarding.
But this is entirely unrelated to STM32 or lwip.
JW
2021-07-14 05:33 AM
JW
2021-07-14 05:57 AM
Once that bit is set how do I capture the packets via LWIP?
2021-07-14 10:25 AM
I'm not interested in this particular problem; lwip is open source and has its own suport mail forum.
A quick look at the sources (lwip 1.4) shows that in ip.c:in_input(), addressed packets which are not addressed to us are considered for forwarding, if IP_FORWARD is defined. In lwip 2, things get muddier thanks to extensive ipv6 support, in ip4.c:ip4_input() I see the same pattern though. So, you may want to hook up your code somewhere there; or maybe even one level lower, at the packet driver level, just after reception.
JW
2021-07-18 08:05 AM
To my understanding LWIP IP_FORWARD definition is for two NICs on the same board.
2021-07-18 08:20 AM
Yes. The intention of that code is, "if it's not for IP bound to this interface, it may be the other interface(s)".
What I said is, that that might be the place to splice in your code handling the unicast packets with not-own-IP.
JW
2021-07-20 11:41 PM
While that might be a good idea, what about ARP reply? would the packets even get there if someone else's answered the ARP request?
2021-07-21 02:29 AM
Yes, you have to use a hub, or a managed switch with properly configured port forwarding.
But this is entirely unrelated to STM32 or lwip.
JW
2021-07-21 04:40 AM
Yes exactly