Skip to main content
deckhard
Associate III
Jul 14, 2021 12:27 PM UTC
Solved

Promiscuous Mode

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

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Jul 21, 2021 9:29 AM UTC

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

8 replies

waclawek.jan
Super User
Jul 14, 2021 12:33 PM UTC

0693W00000BdfZiQAJ.pngJW

deckhard
deckhardAuthor
Associate III
Jul 14, 2021 12:57 PM UTC

Once that bit is set how do I capture the packets via LWIP?

waclawek.jan
Super User
Jul 14, 2021 5:25 PM UTC

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

deckhard
deckhardAuthor
Associate III
Jul 18, 2021 3:05 PM UTC

To my understanding LWIP IP_FORWARD definition is for two NICs on the same board.

waclawek.jan
Super User
Jul 18, 2021 3:20 PM UTC

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

deckhard
deckhardAuthor
Associate III
Jul 21, 2021 6:41 AM UTC

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?

waclawek.jan
waclawek.janBest answer
Super User
Jul 21, 2021 9:29 AM UTC

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

deckhard
deckhardAuthor
Associate III
Jul 21, 2021 11:40 AM UTC

Yes exactly