【问题标题】:Why can't capture rewritten packet为什么无法捕获重写的数据包
【发布时间】:2021-03-06 15:56:08
【问题描述】:

我在 ubuntu 中使用 tcpdump 和 tcpreplay 来捕获数据包并重新发送(在树莓派中为 ap 模式重写和 openwrt。

我的问题是我无法捕获重新发送的数据包。

这是我的网络:

     A          ---->        B(RPI)           ----------->     C
192.168.0.199      eth0.          wlan0      |             192.168.2.172
               192.168.0.100    192.168.2.1  | 
                                              ------------>     D
                                                           192.168.2.222

我将数据包(使用 nping)从 A 发送到 B,并使用了端口转发

在 A 中进行 nping :

nping --udp --dest-port 7777 --dest-ip 192.168.0.100

在 B 中使用 iptables 进行端口转发:

iptables -t nat -A PREROUTING -i eth0 --dport 7777 -j DNAT --to 192.168.2.222

所以,我在这里完成了。

我用 D 写这个

tcpdump -i wlan0 dst port 7777 -w packet.pcap
tcprewrite -i packet.pcap -o packet_rewrite.pcap -D 192.168.2.222:192.168.2.172
tcpreplay -i wlan0 --topspeed packet_rewrite.pcap 

但是,在 C 中,我无法捕获修改后的数据包...

tcpdump dst port 7777

我真的很想知道为什么我不能...请告诉我
我真的很抱歉我的解释不好......

【问题讨论】:

  • 对不起,我忘记解释了。我在 D 中成功了 tcpdump、tcprewrite。

标签: linux openwrt tcpreplay


【解决方案1】:

进一步搜索..我在 B (wlan0) 中捕获了数据包 因为我将数据包的源 mac 编辑到我的 ubuntu wlan mac 地址... 但和以前一样,我无法在 C 中捕获数据包...... This is captured packets in B

甚至重放的数据包也没有通过 iptables...

我解决了!!!!!!!!!!!!!!!

我不得不把dmac改成C的mac地址....我傻了....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 2021-07-25
    相关资源
    最近更新 更多