Score:0

Limit amount of traffic per user in public WiFi network

kr flag

I would like to limit the usage of my free public customer WiFi network to a certain amount of data (i.e. not a bandwidth limit which seems fairly easy to set), let's say 1 GB (or 10 GB or whatever). Management would like to have a fast WiFi for customers, but prevent people from download huge amounts of data the whole day and so take away performance from others.

We are not yet sure which product to select, as it seems that no product can do that out of the box.

For me it seems that this is not a feature from the WiFi APs themselves, but there might be an external framework needed.

But I do have no clue as to how this could be accomplished.

Could this be done by RADIUS accounting? But it seems that it is not possible to disconnect a user after RADIUS accounting detects an exceeding quota (if counting traffic amounts is something RADIUS would even be capable of...)

Or which other mechanisms would be possible here?

If you need a specific product to refer to, I am currently testing with Ubiquiti APs, but the decision on which system to use is not yet made. If this system is not capable of this function but others are, we would probably take one of those others. It's just I haven't found such a system, yet and it's difficult to find information on that topic anywhere in the Internet (or I used the wrong search terms).

So, how can we limit WiFi stations to a certain limit of traffic per day? (By the way, the users do not authenticate. The bandwidth limit should probably be applied on a per MAC address basis. At least that's the direction I'm currently investigating.)

markalex avatar
za flag
It seems like ubiquity has some kind of API, through which you could gather information on your active clients and manipulate them. But I struggle to find official documentation. Here a couple links, that could help you: [1](https://ubntwiki.com/products/software/unifi-controller/api), [2](https://github.com/Art-of-WiFi/UniFi-API-client), [3](https://github.com/Art-of-WiFi/UniFi-API-browser)
Score:0
ca flag

You could use squid proxy server (in forward or transparent mode, all depend of your user's control scenario).

  1. Asign a cuote to every user/IP address storing that data into a database.
  2. Store access log in database (MySQL/Mariadb for example), and every one minut (for example) count http_size of store log for every user, from perl, bash, Python, PHP, ... with cron task. Leave out counting cache HIT, and denied record for example.
  3. Compare the asigned cuote for every user, with the calc consumed data and those user/IP address that overcuote, include him in squid file that point to deny rule.
  4. reconfigure squid in every cycle (Important).
  5. After specific Time (daily, monthly, ..) you must reset the consumed data for every one and release from the restrictive rule.

It will be give you an aproximate data consumed by user/IP address and the possibility to cut off web browsing.

The proposal is very wide, you must consider specifics rules about when you need count the consumed data (all across squid rules).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.