Allow amount of time per device

Is there a way to set a restriction by amount of time verses a schedule? For example, I want to give my son 5 hours of xbox game play a week, but he gets to use those hours when he wants. Or I could give him 20 hours for a month. Maybe have it resolve by static IP, MAC, or host, or all 3?

Is this possible?


What does it mean an "hour of time". If his device sends one ping packet to a server every minute for an hour while he's away riding his bike is this "an hour of time"? Obviously I assume not.

The router doesn't know anything about what a person is doing in front of their computer / device. If someone loads up an eBook on a reader and sits down and reads for an hour, it is perfectly possible to have zero packets hit the router. On the other hand, if you play an interactive game for an hour many packets will go through the router.

I think at best, the router can limit the total transfer per day or per week etc.

I set up a quota system giving my kids about 750MB of YouTube videos each day, but it wasn't trivial to set up. It involved throttling the bandwidth for HTTP/HTTPS ports down to a trickle (< 1 Mbps, to avoid completely breaking certain apps that don't use proxies correctly) and then providing full speed access through a network proxy. Everything uses the proxy, including the kids devices, and whenever the proxy gets a request for a youtube video from one of their machines accessing it tags the packets with a firewall mark. The router then has a quota for such firewall marked packets which shuts off the flow after 750MB and it's reset by cron each night.

However, my router is running Debian, uses nftables, runs Squid proxy, and has a custom Squid config... So if those sound like things you know how to do, then this kind of thing is possible. However, this is not for anyone who has less than several years of Linux administration experience under their belt... it's more or less advanced kung fu.

1 Like

Another"kung fu" approach is the usage of a captive portal, like coova- chilli, and freeradius. The CP can be set up for MAC-auth, to do auto-login.