vaheeD khoshnouD

linux, mikrotik, macosx

Force Disconnect Wireless Stations with Low CCQ in MikroTik

Written by vaheeD on January 19, 2013
4.00 avg. rating (83% score) - 1 vote

This script checks all registered stations and forces a disconnect for any station(s) which has a CCQ level less than that specified below (in this example it’s set to 70% for TX and for RX).

The idea is that once they are forced to disconnect, the stations will attempt to reassociate with the best available AP, eliminating the ‘sticky node’ problem.

The only modifications you need to make is to change your minimum allowed CCQ level.

On your APs:

/system script 
add name="station-check" source="/interface \
   wireless registration-table\r\n:foreach i in=[ /interface wireless registration-table find ap=no] \
   do={\r\n   :if ([get \$i tx-ccq] < \"70\" && [get \$i rx-ccq] < \"70\") do={\r\n           :log warning \
   ([get \$i radio-name] . \" was disconnected due to low CCQ - Tx: \" . [get \$i tx-ccq] . \"% / Rx: \" . \
   [get \$i rx-ccq] . \"%\")\r\n           /interface wireless registration-table remove \$i\r\n           \
   :delay 5s\r\n           }\r\n}"

Important: Remember that non-MikroTik stations will not report back their received CCQ, so the TX-CCQ will always be 0%.
Once you have configured the script, set up a scheduler to run the script everytime you want it to check for low signals. In the example below, the script will run every day at 1 second after midnight!

On your APs:

/system scheduler 
add disabled=no interval=1d name="station-check-schedule" on-event="/system script run \
   station-check ;" start-time=00:00:01


4.00 avg. rating (83% score) - 1 vote

Posted Under: MikroTik

About vaheeD

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam