Skip to main content
Visitor II
July 14, 2021
Solved

Promiscuous Mode

  • July 14, 2021
  • 7 replies
  • 2332 views

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.
    Best answer by waclawek.jan

    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

    7 replies

    Super User
    July 14, 2021

    0693W00000BdfZiQAJ.pngJW

    deckhardAuthor
    Visitor II
    July 14, 2021

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

    Super User
    July 14, 2021

    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

    deckhardAuthor
    Visitor II
    July 18, 2021

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

    Super User
    July 18, 2021

    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

    deckhardAuthor
    Visitor II
    July 21, 2021

    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?

    Super User
    July 21, 2021

    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

    deckhardAuthor
    Visitor II
    July 21, 2021

    Yes exactly