Practical unlang
In the previous chapter, Chapter 6, Accounting, we covered the sql_counter
module. This module is useful to limit the time a user can spend daily, weekly, or monthly on the network, however, sql_counter
has problems in limiting a user's data usage.
Limiting data usage
To limit a user's daily, weekly, or monthly data usage we have to take a different approach. The ability of unlang to use SQL statements as variables opens up a lot of possibilities. We will use the same scenario previously mentioned of Isaac who runs a WISP. Isaac now wants to restrict the amount of data a person can use over a period of time. He makes use of Mikrotik and Coova Chilli captive portals to control network access and has a FreeRADIUS RADIUS server.