How to configure WiFi SSID hopping

(Image credits

SSID hopping enables a wireless monitoring sensor to sequentially test different wifi networks in a round robin fashion. This strategy is very useful when you don’t want to deploy a dedicated sensor for each network available at one location. With the proper configuration, the same sensor will continuously cycle through multiple SSIDs. It will connect to the first one, execute monitoring tests, move on to the next SSID, and then repeat this sequence over and over. The benefits of SSID hopping include detection of problems with AP association, radius authentication, and DHCP addresses availability. On top of that, you can run network and application monitoring tests as usual.

WiFi SSID hopping

SSID hopping in action on a NetBeez WiFi Beez. The red and green lollipops correspond to dissociation and association events with a wireless access point. In this example, the script changes SSID every 5 minutes.

In the following procedure, I will show you how you can implement wireless SSID hopping on NetBeez. Since the WiFi beez runs Linux, nothing prevents you from using this same hack on a regular Linux host. Please be aware that this is a quick and dirty procedure. I am sure that there are much more experienced Linux gurus out there that can come up with a more elegant script and solution.

PLEASE NOTE: If you have a Cloud subscription with WiFi or an Enterprise subscription, the procedure is different. Please follow these steps as documented in the NetBeez community.

Step 1: Request a free NetBeez instance and create your WiFi sensor

If you are new to NetBeez, you must request a free instance, and then follow this procedure to turn your Raspberry Pi, or generic Linux host, into a wireless sensor.

At the end of this step, you will have your wireless sensor reporting to your NetBeez dashboard like in the screenshot below:

Please Note: All the commands run in this example will be executed as root.

Step 2: Create the WPA supplicant configuration files

You will have to create one wpa_supplicant.conf for each network that your wireless sensor should monitor. In this example, we are monitoring two networks, ssid1 and ssid2, both set to authenticate with WPA pre-shared keys. Below are the configuration files that we will store in a dedicated directory. Here, I picked /usr/local/ssid-hopping/ as the dedicated directory in which to store my files.

Here is the content of the configuration file for ssid1 that we will name wpa_supplicant.conf-1:

Here is the content of the configuration file for ssid2 that we will name wpa_supplicant.conf-2:

Step 3: Create the script that will automatically reconfigure the sensor

The goal of this script is to update the /etc/wpa_supplicant/wpa_supplicant.conf file at each run. I also saved this bash script in the /usr/local/ssid-hopping/ directory.

Here is the content of the script:

Make sure to save the script as an executable with the following command:

Step 4: Install the cron job

The last step to do is to install the cron job that will automatically execute the script every five minutes. You can change the interval to suit your needs. Refer to the cron manual if you want to learn more about working with cron.

Now edit the cron configuration file:

Finally add this entry and then save:


When we complete the procedure, the wireless sensor will start hopping through the two (or more) wireless networks that were configured. I hope that this blog post was beneficial for learning a new wireless monitoring technique that will help measure, and improve, the overall end-user experience of your network. I’d love to hear your feedback or answer any questions you may have.