Disconnect device and get visited websites

Hello guys,

I have a list where I can find the connected devices with ip, mac and host. Is it possible to find out for how long it has been connected? For the moment, using cron, every minute I'm checking the list of the connected devices and if a device is connected in 60 consecutive executions I'm sending a notification.

I know that it is possible to disconnect a device from the web interface, but how can I disconnect it programmatically from a bash script? For example, I would like to make a custom blacklist for mac, run my bash script every minute with crontab and if one of the connected devices are on my blacklist, i would like to disconnect it. Or maybe a whitelist and if it's not on my whitelist, i will disconnect the device. I know about MAC-filter, but I would like to make it programmatically, in order to use it in future implementations like disconnecting after one hour.

Also, as adblock is blocking the websites based on DNS, how can I find the DNS request and store the visited websites/IP in a file? Any suggestions?

For disconnecting clients, ubus and hostapd

1 Like

Enable logging in Adblock. It'll let you log everything DNS related, including successful requests and NX returns.