我有一个networking问题,其中与我的主机的源MAC匹配的源MAC帧到达主机 – 一个明显的重复的MAC,或循环,或其他L2问题。
我相信这是因为我的linux网桥的MAC表(CAM表)注册一个本地MAC(托pipe虚拟机)作为上游端口,内核日志显示错误:
bridgename: received packet on bond0.2222 with own address as source address
我想获得关于这些“stream氓”数据包/帧的更多细节,但我无法弄清楚如何将它们归零。 使用tcpdump你可以过滤一个特定的源MAC('ether src MAC'),但这是基于帧中的字节 – 而不是帧是“发送”还是“接收”。 我们通常假设一个源MAC的帧意味着我们将它发送出去,但是如果收到一个重复的帧,内容看起来与filter完全一样。
怎样才能观察一个帧是否被收到,而不是在一个包捕获中传输?
使用--direction选项来tcpdump:
-Q direction --direction=direction Choose send/receive direction direction for which packets should be captured. Possible values are `in', `out' and `inout'. Not available on all platforms.
使用iptables,你有不同的“链”,用于传入和传出数据包。 从iptables(8)手册页:
... the chains INPUT and OUTPUT are only traversed for packets coming into the local host and originating from the local host respectively. Hence every packet only passes through one of the three chains (except loopback traffic, which involves both INPUT and OUTPUT chains) ...
iptables可以做一些日志logging(-l),这可能会告诉你你需要什么。 据推测,它也可以将数据包的副本转发到与其他工具一起login的界面,但我没有理由这样做。