cancel
Showing results for 
Search instead for 
Did you mean: 

Promiscuous Mode

deckhard
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

8 REPLIES 8

0693W00000BdfZiQAJ.pngJW

deckhard
Associate III

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

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

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

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
Associate III

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?

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
Associate III

Yes exactly