Framed-IP-Address, debit pool conflict

Alan DeKok aland at deployingradius.com
Fri Jul 12 15:55:42 CEST 2019


On Jul 12, 2019, at 10:25 AM, Ali Arslan via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> In our system we put users that have unpaid invoices in debit group which has Framed-Pool = debit_pool so they can't access internet.

  That's good.

> But this does not work for users that have static IP because in that case user does not get ip from debit pool.

  Then fix that.

	if (unpaid invoice) {
		allocate IP from debit group
	}
	elsif (static IP) {
		allocate static IP
	}
	else {
		allocate dynamic IP.
	}

> Not to delete radreply record for Framed-IP-Address and to give the same ip back after payment my solution is to add a column named IsActive (tinyint -bool)  to radreply table and change authorize_reply_query in  /etc/freeradius/3.0/mods-config/sql/main/mysql/queries.conf file.as follows:
> authorize_reply_query = "\
>         SELECT id, username, attribute, value, op \
>         FROM ${authreply_table} \
>         WHERE username = '%{SQL-User-Name}' AND IsActive = 1 \
>         ORDER BY id"
> and when putting user in debit group IsActive field is set as 0 and after payment it is set as 1.
> Is it an acceptable solution without side effects, or are there better solutions?

  It may work.  But the better solution is above.

  Alan DeKok.





More information about the Freeradius-Users mailing list