【问题标题】:tcpdump filter out arp and all stp packetstcpdump 过滤掉 arp 和所有 stp 数据包
【发布时间】:2021-08-08 00:14:15
【问题描述】:

我需要使用 tcpdump 在接口上捕获并过滤掉所有 arp 和 stp/rstp 数据包。 我试过这个命令,它确实过滤掉了 arp,但我仍然看到 rstp 数据包:

tcpdump -n -i ens224 not arp and not stp

也试过了,还是看到rstp包

tcpdump -n -i ens224 not stp

我做错了什么?

我已经阅读了这篇文章,但它在 tcpdump 的上下文中没有帮助,寻找特定的语法: how to filter rtsp packets from a pcap file

【问题讨论】:

    标签: filter tcpdump arp stp


    【解决方案1】:

    你没有做错。这是关于 libpcap 和供应商如何读取/写入标头的。要删除 STP 802.1d 行,我使用以下命令:

    tcpdump -i eth0 not arp and not llc

    最好的问候

    【讨论】:

      【解决方案2】:

      您可以为每个协议过滤众所周知的多播 MAC 地址。看看这张表:

      https://embeddist.wordpress.com/2015/10/07/well-known-ethernet-multicast-address/https://en.wikipedia.org/wiki/Multicast_address#Ethernet

      你可以这样:

      (RSTP)

      tcpdump -n -i <interface> ether host 01:00:0c:cc:cc:cd
      

      (CDP)

      tcpdump -n -i <interface> ether host 01:00:0c:cc:cc:cc
      

      (LLDP)

      tcpdump -n -i <interface> ether host 01:80:c2:00:00:0e
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-10
        • 1970-01-01
        • 2019-11-18
        • 1970-01-01
        • 2014-12-23
        相关资源
        最近更新 更多