问题
I am writing a python program that needs to listening to traffic on all networking devices and identify packets based on their incoming interface. To listen on all interfaces I started my capture without specify a device, but I am unable to denote the interface of a particular packet. How is this done?
回答1:
I assume that the MAC address is sufficient information for you.
The first 6 octets of a packet is the destination MAC address, which is immediately followed by the 6 octets of source MAC address.
Source
来源:https://stackoverflow.com/questions/5845719/how-do-you-identify-the-interface-of-a-packet-while-listening-to-network-traffic