@jhochwald
@jhochwald said in CP with Freeradius and MySQL - fixed number of concurrent logins per user:
@EMWEE:
Anyone got a solution for this problem? I cant figure it out.
I need a solution were a username can use 2 MAC's maximum. So one user can register his phone and laptop on the same account.
The Solution is easy:
Open /usr/pbi/freeradius-amd64/etc/raddb/sql/mysql/dialup.conf (or i386 if you run this) and search for the following:
#simul_count_query = "SELECT COUNT(*) \
#FROM ${acct_table1} \
#WHERE username = '%{SQL-User-Name}' \
#AND acctstoptime IS NULL"
Change it to:
simul_count_query = "SELECT COUNT(*) \
FROM ${acct_table1} \
WHERE username = '%{SQL-User-Name}' \
AND acctstoptime IS NULL"
As you can see it works fine:
[2.1.5-RELEASE][root@hotspot.test.lan]/root(24): radtest USER PASS 172.16.1.1:1812 0 Start1234
Sending Access-Request of id 199 to 172.16.1.1 port 1812
User-Name = "USER"
User-Password = "PASS"
NAS-IP-Address = 192.168.1.1
NAS-Port = 0
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Reject packet from host 172.16.1.1 port 1812, id=199, length=68
Reply-Message = "\r\nYou are already logged in - access denied\r\n\n"
[2.1.5-RELEASE][root@hotspot.test.lan]/root(25):
Please note: You must configure the Accounting Table in Service/FreeRADIUS: SQL
If you do not use your SQL Server for, the feature will not work.
P.S.: I configured it on a group base, but it works also per user.
Hi, i cant find this path /usr/pbi/freeradius-amd64/etc/raddb/sql/mysql/dialup.conf (or i386 if you run this)
i am running pfsense 2.4.4-RELEASE-p3 (amd64)
i am looking to limit the logins per user to 2, without a third login kicking out the first one.
kindly guide me through please.