How to limit a specific IP address to 2 hours per day?

I am looking to limit a specific internal IP address of my router to 2 hours of access per day. I have “asked” both Google Bard and ChatGPT but the suggestions they provide don’t work. I figured the experts here might know how to set this up in a router running v6.48.2 (stable).

Kid control.
https://help.mikrotik.com/docs/display/ROS/Kid+Control

(you really thought you would get answers from chatbots, seriously ??)

PS and you might want to consider to upgrade to at least 6.48.6 long term or 6.49.7 stable. Bots didn’t tell you that ? :laughing:

Pay someone to monitor users.

Fantasy Novels don’t work in real life…

Kid Control only allows for certain hours per day (noon to 2, etc) as opposed to 2 hours of general usage. I am trying to limit access to 2 hours regardless of when that access starts.

You would be shocked at what they came back with actually. They provided very detailed ways to use command line and the GUI to make the requested changes that looked like they should work (but didn't!). For instance this is what ChatGPT suggested:

Login to your MikroTik router's GUI interface using your web browser.

Click on the "IP" menu on the left-hand side of the screen, and then click on "Firewall".

Click on the "Filter Rules" tab.

Click on the "Add New" button to create a new filter rule.

In the "General" tab, set the following parameters:
Chain: forward
Src. Address: (enter the specific IP address you want to block)
Protocol: tcp
Dst. Port: 80 (or the port number of the service you want to limit)
Action: accept
Comment: (enter a comment for the rule, if desired)

In the "Extra" tab, add the following parameter:
Timeout: 2h (specify the time limit in hours)

Click on the "OK" button to save the new filter rule.

This rule will allow the specified IP address to access the service (e.g. HTTP) for two hours, after which the connection will be terminated. You can modify this rule to suit your specific requirements by adjusting the source address, protocol, port, action, and timeout parameters.

Below is what Google Bard suggested would work (also did not!)

Log in to your Mikrotik router and go to the IP > Firewall > NAT tab.
Click on the Add button to create a new rule.
In the General tab, set the Protocol to TCP, the Destination Port to Any, and the To Address to the IP address of the device you want to limit.
In the Action tab, select Queue.
In the Queue tab, set the Limit to 2 hours.
Click on the OK button to save your changes.

Once you have created this rule, the device will only be able to access the internet for two hours at a time. After two hours, the device will be disconnected from the internet until the next day.

You can also use this method to limit the amount of time a device can access certain websites or applications. To do this, you would need to create a new rule for each website or application you want to limit. In the Action tab, you would select Application and then select the website or application you want to limit.

ChatGPT is just a means of entertainment, you have to believe in what it tells you, so it writes it and invents it in a plausible way.
Is like watching a science fiction film, it must be at least plausible, but then in reality everything is not always possible…

Can’t you see it’s all bullshit?

And can’t you see that there are invented instructions?
Timeout” as you mean (2h/day) doesn’t exist

And if for hypotesys that “Timeout” parameter actually exists, it’s to limit only THAT link to download that single item…
Every time you open something else the timer would start from zero…

But there is, just not with accumulated/consumed but only absolute time.
Screenshot 2023-04-06 kl. 10.09.24.png

But really? I hope you’re joking…

This rule is used to time the validity of the rule, not to count the time elapsed since the first use…

Just like I explained (ie “time” not “timeout”). But anyhow, never ever trust ChatGPT to provide correct facts!

Yes, is why
http://forum.mikrotik.com/t/petition-request-to-forum-admins-to-prohibit-posting-of-chatgpt-scripts-on-the-forum-without-specify-the-source/164880/1

That will always be difficult, because you will not be able to tell the difference between “device is actually being used” and “device is switched on but has been put aside and kid is doing homework”.

I think some will call this a game of “whackamole” :laughing:

Kids (if we’re talking about kids here) nowadays will ALWAYS find ways to circumvent restrictions. And then you have new problems to solve when raising new barriers.
Proper education and trust should be more suitable, I think.

If school results are sufficient and kid spends 4 hours a day on smartphone or computer and plays in 2 sports teams weekly, I wouldn’t care.
As an example…

I hear you loud and clear, and I am not advocating for any of these AI services in this capacity. I am simply suggesting that I couldn't figure out how to do this on my own, and after searching far and wide in many forums I figured I would give the AI a shot. It completely blew it as you pointed out by asking me to configure settings which don't exist. So now that we all agree AI can't help, is there actually a way to do this?

I am fine breaking this down however it is needed. Can a timer be set the moment a packet is sent/received? He will need to understand that “power on” means the timer is ticking, and I have no issue with enforcing that.

Would this be easier to do if it was the MAC address of the device being limited to 2 hours per day? Sorry for all the questions, I just feel there must be a way to do this!

Hotspot might be able to handle that ?

Sure you can set a DHCP client script that fires when the device connects to the network. It is also possible in DHCP client to add the device to an address list.
Then you can schedule a task 2 hours later that blocks the access for that device.

An easier way???

When you are at home and your smartphone is connected to wifi,
also all devices can register wifi,

When you are not at home, so your smartphone is not registered,
wifi is not available for other devices without permanent authorization.

So when you’re at home and see the finished homework, you can let the child play with the internet…


Of course, it was an example, if you have to start counting the hours it can be done,
but it’s terribly complicated…

Is that 2 hours needs to be accumulated in current day or just allow 2 hours period after first connection in current day?

Probably thats’it..

Total 2 cumulative hours, every 24 hours.
Maybe the counter shouldn’t restart at a time like 24:00 otherwise it would “surf” for 4 hours in a row… (and nothing for the remaining hours of the day)