Scapy:发送原始以太网帧不会显示在 Wireshark 中

问题描述 投票:0回答:0

我想向我的以太网接口发送一个简单的数据包:“enp0s31f6”。我已经尝试使用我的 wifi 卡发送一个 L3 IP 数据包并且它工作正常,但是使用 L2 功能并发送一个原始的 Eth 帧显示“已发送 1 个数据包”但没有出现在 Wireshark 中。

我有一个非常简单的脚本。

from scapy.all import *

g = Ether(dst=get_if_hwaddr("enp0s31f6"))
sendp(g, iface="enp0s31f6")

输出显示:

.
Sent 1 packets.

但是,在 enps031f6 频道上查看 Wireshark,我根本没有看到任何数据包被发送。与 tcpdump 相同。任何想法? 我已经确认 get_if_hwaddr 为我正在使用的接口提供了正确的 MAC 地址。

python python-3.x networking network-programming scapy
© www.soinside.com 2019 - 2024. All rights reserved.