T
T
theodorheia2021-02-16 19:31:04
Mikrotik
theodorheia, 2021-02-16 19:31:04

Is it possible to write a script to forcefully disconnect a user from WiFi?

Good day, dear forum users!

I have a glitch on my Mikrotik access points. It lies in the fact that some users send their laptops to sleep, and they do not turn off from access points. Their Last Activity indicator in the Registration tab begins to grow, and when it reaches 200 seconds, all interface traffic falls - connected users have no Internet. You have to manually select the user and click Remove.

I just want to know, purely hypothetically, is it possible to write a script that will execute the Remove command when the client reaches the Last Activity value of 150 seconds?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-02-17
@theodorheia

It is simply scripted. The following command will add a script to the scheduler that will run every 20 seconds and delete registrations of clients that have been inactive for more than 150 seconds:

/system scheduler add interval=20s name=unreg_inactive_wifi_clients on-event="/interface wireless registration-table remove  [ find  last-activity > 150 ]"  start-date=jun/01/1970 start-time=00:00:00

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question