How to disconnect wireless client

hello is it possible to have a script that once the host get associated to wifi AP it will be disconnected - i need to script that - somehow?

edit: to simplify> can I disconnect a specific mac address from wifi AP at a specific time?

thanks!

  1. Add an option macfilter 'deny' to the corresponding wifi-iface.
  2. Create cron jobs with ban and unban actions like this:
0 22 * * * uci add_list wireless.default_radio1.maclist="01:23:45:67:89:AB"; wifi reload
0 7 * * * uci revert wireless; wifi reload

Don't forget to restart the cron service. Note that if someone restarts the router in the meantime, the device will get wifi access again.

hm thats something else... i think?

I want to disconnect one specific mac address (client) as clicking in GUI

i don't wanna to apply any specific macfilter etc...

This will disconnect and ban the client for 60 seconds:

ubus call hostapd.wlan1 del_client "{'addr':'01:23:45:67:89:AB', 'reason':5, 'deauth':true, 'ban_time':60000}"
2 Likes

@pavelgl okay thanks so i assume i can execute that one via Crontab and the client will then recconect.

see that every day at 8.05am works like that>

5 8 * * * ubus call hostapd.wlan1 del_client "{'addr':'00:0C:8A:4E:21:93', 'reason':5, 'deauth':true, 'ban_time':60000}"

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.