How to Configure WiFi SSID Hopping

(Image credits https://unsplash.com/@wrrobinson)

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.

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

If you are new to NetBeez, you must sign-up to NetBeez and activate your WiFi 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: Update the network configuration file

Now we need to modify the /etc/network/interfaces configuration file so that the SSID hopping configuration doesn’t conflict with other processes managing the WiFi interface (e.g. NetBeez). To do that, update the configuration file passed in argument to the wpa_supplicant command with the -c option from /etc/wpa_supplicant/wpa_supplicant.conf to /usr/local/ssid-hopping/wpa_supplicant.conf:

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

The goal of this script is to update the /usr/local/ssid-hopping/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 change-ssid.sh script:

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

Create the control file used by the ssid-hopping.sh script:

Step 5: 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:

Conclusion

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.