Wireless Access

Reply
New Contributor

Temporarily blacklisting clients in bulk

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.

Re: Temporarily blacklisting clients in bulk

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

 

Contributor I

Re: Temporarily blacklisting clients in bulk

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.

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: