Discussion:
freeradius with multi mysql database and multi virtual server
Muhammed Buvaydani
2018-11-14 05:59:40 UTC
Permalink
0down votefavorite<https://stackoverflow.com/questions/53293884/freeradius-with-multi-mysql-database-and-multi-virtual-server>

I have tow NAS and I want to run freeradius server with tow database (one database for every NAS); I have tow sql modules the first one is SQL and the another one is SQL1 the SQL module configured to connect to radius database , SQL1 configured to connect to radius2 database . in

/etc/freeradius/sites-enabled

folder I created new virtual server which has name student so in that folder there are tow file (default, student); I configured default to work with SQL module which connect to radius database,whereas I configured student to connect to SQL1 module which connect to radius2 database . I added this unlang code in every virtual server file to get information from every database

Tmp-String-0 := "%{sql:SELECT value from radcheck WHERE attribute='CS-Total-Octets-Daily' and username='%{User-Name}'}"

Tmp-String-1 := "%{sql:SELECT sum(AcctInputOctets)+sum(AcctOutputOctets) AS

Total FROM radacct where DATE(AcctstartTime )= CURDATE() AND

radacct.username='%{User-Name}'}"

but my problem is that the student virtual server trying to get this data from radius database which is belong to SQL module even if I configured it to work with SQL1 . why is that happen , and how can I solve it


-
List info/subscribe/unsubscrib
mohamad buvaydanı
2018-11-14 06:01:08 UTC
Permalink
favorit
<https://stackoverflow.com/questions/53293884/freeradius-with-multi-mysql-database-and-multi-virtual-server#>I
have tow NAS and I want to run freeradius server with tow database (one
database for every NAS); I have tow sql modules the first one is SQL and
the another one is SQL1 the SQL module configured to connect to radius
database , SQL1 configured to connect to radius2 database . in

/etc/freeradius/sites-enabled

folder I created new virtual server which has name student so in that
folder there are tow file (default, student); I configured default to work
with SQL module which connect to radius database,whereas I configured
student to connect to SQL1 module which connect to radius2 database . I
added this unlang code in every virtual server file to get information from
every database

Tmp-String-0 := "%{sql:SELECT value from radcheck WHERE
attribute='CS-Total-Octets-Daily' and username='%{User-Name}'}"
Tmp-String-1 := "%{sql:SELECT sum(AcctInputOctets)+sum(AcctOutputOctets) AS
Total FROM radacct where DATE(AcctstartTime )= CURDATE() AND
radacct.username='%{User-Name}'}"

but my problem is that the student virtual server trying to get this data
from radius database which is belong to SQL module even if I configured it
to work with SQL1 . why is that happen , and how can I solve it
-
List info/subscribe/unsubscribe? See http://www.
Alan Buxey
2018-11-14 15:19:12 UTC
Permalink
Use sql1: in the unlang instead of sql:

...or don't use the same virtual server and define a new virtual server
instance and use the virtual_server directive in the clients.conf to ensure
all requests from the second NAS go through that different server config

alan
Post by Muhammed Buvaydani
favorit
<
https://stackoverflow.com/questions/53293884/freeradius-with-multi-mysql-database-and-multi-virtual-server#
I
have tow NAS and I want to run freeradius server with tow database (one
database for every NAS); I have tow sql modules the first one is SQL and
the another one is SQL1 the SQL module configured to connect to radius
database , SQL1 configured to connect to radius2 database . in
/etc/freeradius/sites-enabled
folder I created new virtual server which has name student so in that
folder there are tow file (default, student); I configured default to work
with SQL module which connect to radius database,whereas I configured
student to connect to SQL1 module which connect to radius2 database . I
added this unlang code in every virtual server file to get information from
every database
Tmp-String-0 := "%{sql:SELECT value from radcheck WHERE
attribute='CS-Total-Octets-Daily' and username='%{User-Name}'}"
Tmp-String-1 := "%{sql:SELECT sum(AcctInputOctets)+sum(AcctOutputOctets) AS
Total FROM radacct where DATE(AcctstartTime )= CURDATE() AND
radacct.username='%{User-Name}'}"
but my problem is that the student virtual server trying to get this data
from radius database which is belong to SQL module even if I configured it
to work with SQL1 . why is that happen , and how can I solve it
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/use
Loading...