设置树莓派的无线网卡为监听模式(monitor)
发布日期:2022-03-18 18:19:19 浏览次数:3 分类:技术文章

本文共 2168 字,大约阅读时间需要 7 分钟。

先使用命令查看无线网卡的名字:

ifconfig

结果如下:

eth0: flags=4163
mtu 1500 inet 192.168.123.165 netmask 255.255.255.0 broadcast 192.168.123.255 inet6 fe80::8ced:f8c8:81e:4e78 prefixlen 64 scopeid 0x20
ether b8:27:eb:5f:7f:23 txqueuelen 1000 (Ethernet) RX packets 241360939 bytes 36052043728 (33.5 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 533542201 bytes 738621286186 (687.8 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73
mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback) RX packets 269480 bytes 11338213 (10.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 269480 bytes 11338213 (10.8 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0wlan0: flags=4099
mtu 1500 ether b8:27:eb:0a:2a:76 txqueuelen 1000 (Ethernet) 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

其中的wlan0就是树莓派自带的无线网卡。

打开无线网卡的监听模式:

ifconfig wlan0 mode monitor

会报错:

mode: Unknown hostifconfig: `--help' gives usage information.

使用如下命令查看无线网卡是否支持监听模式(monitor):

iw list

输出结果如下:

Supported interface modes:                 * IBSS                 * managed                 * AP                 * P2P-client                 * P2P-GO                 * P2P-device

我发现树莓派自带的无线网卡不支持监听模式(monitor)

然后我使用支持监听模式(monitor)的无线网卡,这类网卡有很多,我用的是8187L无线网卡。
然后使用命令

iw list

可以看出支持监听模式(monitor):

Supported interface modes:                 * IBSS                 * managed                 * AP                 * AP/VLAN                 * monitor                 * mesh point

开启监听模式(monitor):

ifconfig wlan1 downiwconfig wlan1 mode monitorifconfig wlan1 up

查看是否成功开启监听模式(monitor):

iwconfig

结果如下,开启成功:

wlan1     IEEE 802.11  Mode:Monitor  Frequency:2.412 GHz  Tx-Power=30 dBm             Retry short  long limit:2   RTS thr:off   Fragment thr:off          Power Management:off

转载地址:https://zhang0peter.blog.csdn.net/article/details/84582971 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:OpenGL(glut)模拟太阳系:太阳,地球,月球,火星
下一篇:打造自己的树莓派监控系统3--canvas.js绘制数据

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年03月28日 22时52分55秒