无法通过 tcpreplay 从 WSL2 向树莓派发送数据包

无法通过 tcpreplay 从 WSL2 向树莓派发送数据包

我正在尝试将数据包从我的 pcap 文件发送到我的树莓派。我在 Windows 笔记本电脑上使用 WSL2 盒通过 wifi 发送数据包。

WSL2 可以 ping 通树莓派

--- 192.168.1.79 ping statistics ---
240 packets transmitted, 239 received, 0.416667% packet loss, time 239444ms
rtt min/avg/max/mdev = 3.469/38.258/621.335/103.481 ms

Wireshark 确认:

在此输入图像描述

但是当我运行 tcpreplay 时

sudo tcpreplay -i eth0 -K /home/barry/pcaps/HomeWifi.pcap

我在 Wireshark 上没有得到任何输出。尽管有 WSL2 输出,Pi 仍没有收到数据包:

$ sudo tcpreplay -i eth0 -K HomeWifi.pcap
File Cache is enabled

quit
^C User interrupt...
sendpacket_abort
Actual: 60297 packets (69710756 bytes) sent in 35.94 seconds
Rated: 1939345.8 Bps, 15.51 Mbps, 1677.45 pps
Statistics for network device: eth0
        Successful packets:        60296
        Failed packets:            0
        Truncated packets:         0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0

我很困惑为什么 ping 有效,但 tcpreplay 却不起作用。有解决办法吗?

WSL2 的 ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.168.66  netmask 255.255.240.0  broadcast 172.25.175.255
        inet6 fe80::215:5dff:fe5e:97d0  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:5e:97:d0  txqueuelen 1000  (Ethernet)
        RX packets 238947  bytes 343765801 (343.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 267814  bytes 285573706 (285.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

相关内容