0

I am brand new to raspberry pi and have been trying to follow a few tutorials to try to set it up as a network scanner (https://www.hackster.io/aallan/a-raspberry-pi-network-scanner-e3dbbc , https://pimylifeup.com/raspberry-pi-network-scanner/) for a school project. The wifi adapter I am using is a realtek adapter that uses the RTL8188EUS chipset and says that it supports monitor mode when I run commands. When I get to the step that says to edit the i/etc/network/interfaces config file and add the entry :

allow-hotplug wlan1

 iface wlan1 inet manual

 pre-up iw phy phy1 interface add mon1 type monitor

 pre-up iw dev wlan1 del

 pre-up ifconfig mon1 up

It saves correctly but on reboot it either switches my wlan0 and wlan1 (onboard wifi and realtek adapter) or it won't boot in general. Is there a reason it is having this behaviour?

The OS installed is Rasbian (using os configured from sd card from canakit).

I have also tried setting up a monitor interface by running the sudo iw phy phy1 interface add mon1 type monitor command and then doing ifconfig mon1 up to start it up. Once I do this though the interface does not pick up any packets(i tried changing the channel but am unable to do so as an error is brought up which says device or resource busy), maybe I am misunderstanding how this works. I have attached a few screenshots below showing this approach first being the result of the config command.

Any help with this issue would be much appreciated.

screenshot

Milliways
  • 54,718
  • 26
  • 92
  • 182
Harrison
  • 3
  • 1
  • Any tutorial recommending doing anything to interfaces OR using ifup is obsolete. Try something up to date. – Milliways Oct 30 '21 at 21:27

1 Answers1

0

This is not an Answer to all the Questions you asked, but may help.

"it either switches my wlan0 and wlan1" this is normal, interface names are assigned in the order they are enumerated and there is no (simple) solution.

The normal Linux approach is to use Predictable Network Interface Names. The internal WiFi will ALWAYS be wlan0 - there is no possible confusion, although it is possible to create a udev rule.

I suggest you Enable predictable network i/f names in the Advanced option of raspi_config. This avoids a race condition which can result in the wrong interface being configured.

Use of /etc/network/interfaces is discouraged in Raspberry Pi OS, although it CAN be used for an interface (such as monitor mode) if you add denyinterfaces … to the end of /etc/dhcpcd.conf (but above any other added interface lines) to prevent dhcpcd from attempting to configure it.

There is no reason to ever use pre-up or similar.

See Prevent dhcpcd from configuring an interface and Predictable Network Interface Names in How to set up networking/WiFi

NOTE You may find other methods of using monitor mode on this Forum.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • Thanks, your post cleared up a lot of my confusion with the network names! I was able to get the monitor mode working by killing some processes that interfered with it/reset the mode. Weird no sources online mentioned those processes and how the mode can be reset by them. – Harrison Oct 31 '21 at 04:33