导航:https://blog.csdn.net/yudelian/article/details/129182837
android(linux)设备:
主设备设置混杂模式:
ifconfig eth0 promisc
然后通过tcpdump -i eth0 -p 可以抓所以经过eth0(eth0虚拟的各种vlan或者网桥)的包
qnx设备
命令 nicinfo
#nicinfo
Physical Node ID ........................... 000102 C510D4 Current Physical Node ID ................... 000102 C510D4 Current Operation Rate ..................... 100.00 Mb/s full-duplex Active Interface Type ...................... MII Active PHY Address ......................... 3 Power Management State ..................... Active Maximum Transmittable data Unit ............ 1514 Maximum Receivable data Unit ............... 1514 Receive Checksumming Enabled ............... TCPv6 Transmit Checksumming Enabled .............. TCPv6 Hardware Interrupt ......................... 0x5 DMA Channel ................................ 0 I/O Aperture ............................... 0xd400 - 0xd47f ROM Aperture ............................... 0 Memory Aperture ............................ 0xe6000000 - 0xe6000FFF Promiscuous Mode ........................... Off Multicast Support .......................... Enabled
可以看到这个混杂模式,这个应该通过驱动设置的,我们的qnx默认就是on
然后通过tcpdump抓包:
-p
Don't put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, you can't use -p as an abbreviation for ether host {local-hw-addr} or ether broadcast.
也是通过
tcpdump -i eth0 -p 可以抓混杂包
注意:
1、主设备顾虑 虚拟机的数据包,有时候过滤不出来
在qnx侧的主网络设备 emac0抓包时发现,虚拟的vlan3的ping包request和response都有,但是emac0在混杂模式下只看到request包,没有response包,但是抓包文件在wireshark上能看到reply包
2、以防出错,可以通过tcpdump 后用grep 过滤