0

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.)

1
  • 1
    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, 2, 3
    – markalex
    Mar 15 at 8:59

1 Answer 1

0

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.