Wireless Access

 View Only
last person joined: 22 hours ago 

Access network design for branch, remote, outdoor, and campus locations with HPE Aruba Networking access points and mobility controllers.
Expand all | Collapse all

Temporarily blacklisting clients in bulk

This thread has been viewed 1 times
  • 1.  Temporarily blacklisting clients in bulk

    Posted Mar 13, 2018 02:48 PM

    Hello, I know there is a way to blacklist a client via CLI. Easy enough.

     

    But I need to blacklist approx 160ish clients temporarily and I obviously do not want to have to do this manually. 

     

    Is there a way to accomplish this via a script that I point to a file with the mac addresse via CLI?

     

    Thanks in advance.



  • 2.  RE: Temporarily blacklisting clients in bulk

    Posted Mar 13, 2018 10:53 PM

    for a once off, perhaps do it just using bash style shell. if you have access to any unix system log into that, else if on windows, either install cygwin bash (or figure the conversion to powershell) or maybe easier use perl/python

     

    if you have a file of mac addresses, like this

     

    $ cat macs.txt
    00:11:22:33:44:55
    11:22:33:44:55:66
    aa:22:33:bb:44:55

    then use a one liner to generate the CLI commands, like this

     

     

    $ for i in `cat macs.txt`; do echo "stm add-blacklist-client $i"; done
    stm add-blacklist-client 00:11:22:33:44:55
    stm add-blacklist-client 11:22:33:44:55:66
    stm add-blacklist-client aa:22:33:bb:44:55
    $

    here is a perl version to achieve the same

    c:\temp> perl -ne 'print("stm add-blacklist-client $_")' macs.txt
    stm add-blacklist-client 00:11:22:33:44:55
    stm add-blacklist-client 11:22:33:44:55:66
    stm add-blacklist-client aa:22:33:bb:44:55
    c:\temp>

    now copy and paste them into the CLI of the controller, perhaps 50 lines at a time.

     

     

    hth

     



  • 3.  RE: Temporarily blacklisting clients in bulk

    Posted Mar 14, 2018 02:42 AM

    You could also create the commands in Excel really quickly. Dump the MACs in one column, the command in another column, and in a third column concatenate them together. Put $ signs around the CLI command in the formula so it doesn't change per row. Click fill handle in the bottom right of the rield and drag down. Copy all of that and dump into the command line.