Assuming this is your Pi:
root@pitest:~# ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:92:87:21 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
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
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.112 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2404:9400:218b:2f02:d594:ce48:6b42:62cc prefixlen 64 scopeid 0x0<global>
inet6 fe80::62f2:4123:c13d:355b prefixlen 64 scopeid 0x20<link>
ether 00:36:76:b0:23:61 txqueuelen 1000 (Ethernet)
RX packets 36282 bytes 7932636 (7.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3519 bytes 517860 (505.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Run the command:
iw wlan0 interface add mon0 type monitor
That creates a new mon0
interface:
root@pitest:~# ifconfig mon0
mon0: flags=4098<BROADCAST,MULTICAST> mtu 1500
unspec 00-36-76-B0-23-61-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
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
The mon0
interface can then be used to monitor the WiFi radio (if monitoring works on your hardware):
ifconfig mon0 up
tcpdump -c 100 -n -i mon0
You can issue these commands as above from the root shell prompt and, assuming your Pi's WiFi interface works for monitor mode, you can monitor transmissions until next reboot.
On the other hand, if you want monitoring to start from boot time you will need to edit configuration files. Out of the box, Debian buster enables dhcpcd
to automatically configure your WiFi interfaces when it finds them.
If you edit /etc/network/interfaces
then dhcpcd
notices it and stops all configuration. So you will need to add both your WiFi interfaces to it. This would be a suitable paragraph for your wlan1:
allow-hotplug wlan1
iface wlan1 inet manual
pre-up iw wlan1 interface add mon1 type monitor
pre-up ifconfig mon1 up
You should reboot after editing /etc/network/interfaces
to apply the changes (and make sure everything works after a reboot, of course).
arp -a
to list them? – Sep 11 '20 at 01:24