在 Debian 上调试 dumpcap(Wireshark 抓包后端)错误,通常可以从权限、依赖、内核参数、日志几个方向入手。下面按常见场景给你一套排查流程。
which dumpcap
dumpcap -v
如果找不到:
sudo apt update
sudo apt install wireshark-common
Couldn't run /usr/bin/dumpcap in child process: Permission denied
sudo dpkg-reconfigure wireshark-common
# 选 "yes"
sudo usermod -aG wireshark $USER
重新登录或重启
验证:
groups
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
getcap /usr/bin/dumpcap
dumpcap -D
或
ip link
eth0 不存在(可能是 ens33、enp0s3)sudo ip link set eth0 up
sudo dumpcap -i eth0 -w test.pcap -f "tcp" -d
常用参数:
-d:显示编译后的过滤规则-f:BPF 过滤表达式-w:写文件-c:抓包数量journalctl -xe
dmesg | tail
netlink error: Operation not permittedcap_net_adminCan't open eth0: Device or resource busysudo lsof | grep pcap
sudo ip link set eth0 promisc on
sudo apt install linux-tools-common
sudo dumpcap -i any -w /tmp/test.pcap -c 10
然后:
tshark -r /tmp/test.pcap
如果你能贴出具体的错误信息(命令行输出或日志),我可以更精准地帮你定位。