Can anyone give me some pointers on how to get this work ?<br><br><div class="gmail_quote">On Sat, Mar 12, 2011 at 4:24 PM, Suman Dash <span dir="ltr"><<a href="mailto:sumandash@gmail.com">sumandash@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I am facing some issues in making the rlm_sqlcounter worj with freeradius 2.1.9 . I am unable to understand that why the Wiki and the actual config files are different .<br>
<br>The wiki link <a href="http://wiki.freeradius.org/Rlm_sqlcounter" target="_blank">http://wiki.freeradius.org/Rlm_sqlcounter</a> shows an example in which there is no Reply-Name whereas the sql/mysql/counter.conf shows a Reply-Name attribute..<br>
<br>The config part :<br><br>radiusd.conf<br><br><br> $INCLUDE ${confdir}/modules/<br><br> # Extensible Authentication Protocol<br> #<br> # For all EAP related authentications.<br> # Now in another file, because it is very large.<br>
#<br> $INCLUDE eap.conf<br><br> # Include another file that has the SQL-related configuration.<br> # This is another file only because it tends to be big.<br> #<br> $INCLUDE sql.conf<br>
<br> #<br> # This module is an SQL enabled version of the counter module.<br> #<br> # Rather than maintaining seperate (GDBM) databases of<br> # accounting info for each counter, this module uses the data<br>
# stored in the raddacct table by the sql modules. This<br> # module NEVER does any database INSERTs or UPDATEs. It is<br> # totally dependent on the SQL module to process Accounting<br> # packets.<br>
#<br> $INCLUDE sql/mysql/counter.conf<br><br> #<br> # IP addresses managed in an SQL table.<br> #<br> $INCLUDE sqlippool.conf<br>}<br><br><br><br>instantiate {<br> #<br>
# Allows the execution of external scripts.<br>
# The entire command line (and output) must fit into 253 bytes.<br> #<br> # e.g. Framed-Pool = `%{exec:/bin/echo foo}`<br> exec<br><br> #<br> # The expression module doesn't do authorization,<br>
# authentication, or accounting. It only does dynamic<br> # translation, of the form:<br> #<br> # Session-Timeout = `%{expr:2 + 3}`<br> #<br> # So the module needs to be instantiated, but CANNOT be<br>
# listed in any other section. See 'doc/rlm_expr' for<br> # more information.<br> #<br> expr<br> daily<br> expiration<br> logintime<br><br> #<br> # We add the counter module here so that it registers<br>
# the check-name attribute before any module which sets<br> # it<br><br>sql/mysql/counter.conf<br><br>sqlcounter dailycounter {<br> counter-name = Daily-Session-Time<br> check-name = Max-Daily-Session<br>
reply-name = Session-Timeout<br> sqlmod-inst = sql<br> key = User-Name<br> reset = daily<br><br> query = "SELECT SUM(acctsessiontime - \<br> GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \<br>
FROM radacct WHERE username = '%{%k}' AND \<br> UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"<br><br>}<br><br>sqlcounter monthlycounter {<br> counter-name = Monthly-Session-Time<br>
check-name = Max-Monthly-Session<br> reply-name = Session-Timeout<br> sqlmod-inst = sql<br> key = User-Name<br> reset = monthly<br><br> query = "SELECT SUM(acctsessiontime - \<br>
GREATEST((%b - UNIX_TIMESTAMP(acctstarttime)), 0)) \<br> FROM radacct WHERE username='%{%k}' AND \<br> UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%b'"<br>
}<br><br>sqlcounter noresetcounter {<br> counter-name = Max-All-Session-Time<br> check-name = Max-All-Session<br> sqlmod-inst = sql<br> key = User-Name<br> reset = never<br>
query = "SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{%k}'"<br>}<br><br><br><br>sites-enabled/default <br><br><br><dl><dd>authorize {
<dl><dd> ..........
</dd><dd> noresetcounter
</dd><dd> dailycounter
</dd><dd> monthlycounter
</dd><dt> daily<br></dt></dl>
</dd><dd> }
</dd></dl><br>What bothers me is the Reply-Name defined is already instantiated by freeradius for daily counter. <br><br>DB Scheme<br><br><table><tbody><tr><td>
suman</td>
<td>Max-Daily-Session</td>
<td>:=</td>
<td>10</td></tr></tbody></table><table><tbody><tr><td>suman</td>
<td>Expiration</td>
<td>:=</td>
<td>05 Mar 2012 23:59:59</td></tr></tbody></table><br>NTRadPing Output<br><br>Session-Timeour = 10 ( Which is Infact Correct )<br><br>But When i change the Max-Daily-Session to Max-Monthly-Session <br><br><br><table>
<tbody><tr></tr><tr><td>suman</td><td>Max-Monthly-Session</td><td>:=</td><td>10</td></tr></tbody></table><table><tbody><tr>
<td>suman</td>
<td>Expiration</td>
<td>:=</td>
<td>05 Mar 2012 23:59:59</td></tr></tbody></table><br>NTRadPing Output<br>
<br>
Session-Timeour = 10 ( Which is Infact Correct )<br>
<br>
But When i change the Max-Daily-Session to Max-Monthly-Session <br>
<br>NTRadPing gives the total session timeout based on the user expiration date .<br><br><br>Debug Log for Max-Daily-Session:<br><br>Listening on authentication address * port 1812<br>Listening on accounting address * port 1813<br>
Listening on proxy address * port 1814<br>Ready to process requests.<br>rad_recv: Access-Request packet from host 122.175.85.117 port 26130, id=39, length=59<br> User-Name = "suman"<br> User-Password = "duman12"<br>
Calling-Station-Id = "001122334455"<br>+- entering group authorize {...}<br>++[preprocess] returns ok<br>++[chap] returns noop<br>++[mschap] returns noop<br>[suffix] No '@' in User-Name = "suman", looking up realm NULL<br>
[suffix] No such realm "NULL"<br>++[suffix] returns noop<br>[eap] No EAP-Message, not doing EAP<br>++[eap] returns noop<br>++[unix] returns notfound<br>++[files] returns noop<br>[sql] expand: %{User-Name} -> suman<br>
[sql] sql_set_user escaped user --> 'suman'<br>rlm_sql (sql): Reserving sql socket id: 3<br>[sql] expand: SELECT id, username, attribute, value, op FROM tbl_check WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM tbl_check WHERE username = 'suman' ORDER BY id<br>
[sql] User found in radcheck table<br>[sql] expand: SELECT id, username, attribute, value, op FROM tbl_reply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM tbl_reply WHERE username = 'suman' ORDER BY id<br>
[sql] expand: SELECT groupname FROM tbl_usergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM tbl_usergroup WHERE username = 'suman' ORDER BY priority<br>
[sql] expand: SELECT id, groupname, attribute, Value, op FROM tbl_groupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM tbl_groupcheck WHERE groupname = 'Biz1Mbps-UL' ORDER BY id<br>
[sql] User found in group Biz1Mbps-UL<br>[sql] expand: SELECT id, groupname, attribute, value, op FROM tbl_groupreply WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, value, op FROM tbl_groupreply WHERE groupname = 'Biz1Mbps-UL' ORDER BY id<br>
rlm_sql (sql): Released sql socket id: 3<br>++[sql] returns ok<br>rlm_sqlcounter: Entering module authorize code<br>rlm_sqlcounter: Could not find Check item value pair<br>++[noresetcounter] returns noop<br>rlm_sqlcounter: Entering module authorize code<br>
rlm_sqlcounter: Could not find Check item value pair<br>++[monthlycounter] returns noop<br>rlm_sqlcounter: Entering module authorize code<br>sqlcounter_expand: 'SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200''<br>
[dailycounter] expand: SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200' -> SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200'<br>
sqlcounter_expand: '%{sql:SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200'}'<br>
[dailycounter] sql_xlat<br>[dailycounter] expand: %{User-Name} -> suman<br>[dailycounter] sql_set_user escaped user --> 'suman'<br>[dailycounter] expand: SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200' -> SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200'<br>
rlm_sql (sql): Reserving sql socket id: 2<br>rlm_sql_mysql: MYSQL check_error: 1146 received<br>rlm_sql (sql): database query error, SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200': Table 'rdscrm.radacct' doesn't exist<br>
rlm_sql (sql): Released sql socket id: 2<br>[dailycounter] expand: %{sql:SELECT SUM(acctsessiontime - GREATEST((1299868200 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1299868200'} -><br>
rlm_sqlcounter: No integer found in string ""<br>++[dailycounter] returns noop<br>rlm_counter: Entering module authorize code<br>rlm_counter: Searching the database for key 'suman'<br>rlm_counter: Could not find the requested key in the database.<br>
rlm_counter: Check item = 10, Count = 0<br>rlm_counter: res is greater than zero<br>rlm_counter: (Check item - counter) is greater than zero<br>rlm_counter: Authorized user suman, check_item=10, counter=0<br>rlm_counter: Sent Reply-Item for user suman, Type=Session-Timeout, value=10<br>
++[daily] returns ok<br>rlm_checkval: Item Name: Calling-Station-Id, Value: 001122334455<br>rlm_checkval: Value Name: Calling-Station-Id, Value: 001122334455<br>++[checkval] returns ok<br>[expiration] Checking Expiration time: '05 Mar 2012 23:59:59'<br>
++[expiration] returns ok<br>++[logintime] returns noop<br>++[pap] returns updated<br>Found Auth-Type = PAP<br>+- entering group PAP {...}<br>[pap] login attempt with password "duman12"<br>[pap] Using CRYPT encryption.<br>
[pap] User authenticated successfully<br>++[pap] returns ok<br>+- entering group session {...}<br>[radutmp] expand: /var/log/freeradius/radutmp -> /var/log/freeradius/radutmp<br>[radutmp] expand: %{User-Name} -> suman<br>
++[radutmp] returns ok<br>+- entering group post-auth {...}<br>rlm_sql (sql): Reserving sql socket id: 1<br>[sqlippool] expand: %{User-Name} -> suman<br>[sqlippool] sql_set_user escaped user --> 'suman'<br>
[sqlippool] expand: START TRANSACTION -> START TRANSACTION<br>[sqlippool] expand: UPDATE tbl_ippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '%{Nas-IP-Address}' -> UPDATE tbl_ippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '122.175.85.117'<br>
[sqlippool] expand: SELECT framedipaddress FROM tbl_ippool WHERE pool_name = '%{control:Pool-Name}' AND expiry_time IS NULL ORDER BY RAND() LIMIT 1 FOR UPDATE -> SELECT framedipaddress FROM tbl_ippool WHERE pool_name = 'main_pool' AND expiry_time IS NULL ORDER BY RAND() LIMIT 1 FOR UPDATE<br>
[sqlippool] expand: UPDATE tbl_ippool SET nasipaddress = '%{NAS-IP-Address}', pool_key = '%{NAS-Port}', callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', expiry_time = NOW() + INTERVAL 180 SECOND WHERE framedipaddress = '192.168.1.20' AND expiry_time IS NULL -> UPDATE tbl_ippool SET nasipaddress = '122.175.85.117', pool_key = '', callingstationid = '001122334455', username = 'suman', expiry_time = NOW() + INTERVAL 180 SECOND WHERE framedipaddress = '192.168.1.20' AND expiry_time IS NULL<br>
[sqlippool] Allocated IP 192.168.1.20 [1401a8c0]<br>[sqlippool] expand: COMMIT -> COMMIT<br>rlm_sql (sql): Released sql socket id: 1<br>[sqlippool] expand: Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name}) -> Allocated IP: 192.168.1.20 from main_pool (did cli 001122334455 port user suman)<br>
Allocated IP: 192.168.1.20 from main_pool (did cli 001122334455 port user suman)<br>++[sqlippool] returns ok<br>[reply_log] expand: /var/log/freeradius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d -> /var/log/freeradius/radacct/<a href="http://122.175.85.117/reply-detail-20110312" target="_blank">122.175.85.117/reply-detail-20110312</a><br>
[reply_log] /var/log/freeradius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d expands to /var/log/freeradius/radacct/<a href="http://122.175.85.117/reply-detail-20110312" target="_blank">122.175.85.117/reply-detail-20110312</a><br>
[reply_log] expand: %t -> Sat Mar 12 16:18:51 2011<br>
++[reply_log] returns ok<br>[sql] expand: %{User-Name} -> suman<br>[sql] sql_set_user escaped user --> 'suman'<br>[sql] expand: %{User-Password} -> duman12<br>[sql] expand: INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( '%{User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S') -> INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( 'suman', 'duman12', 'Access-Accept', '2011-03-12 16:18:51')<br>
rlm_sql (sql) in sql_postauth: query is INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( 'suman', 'duman12', 'Access-Accept', '2011-03-12 16:18:51')<br>
rlm_sql (sql): Reserving sql socket id: 0<br>rlm_sql (sql): Released sql socket id: 0<br>++[sql] returns ok<br>++[exec] returns noop<br>Sending Access-Accept of id 39 to 122.175.85.117 port 26130<br> Framed-MTU := 1472<br>
Reply-Message := "Welcome to Internet Services"<br> Acct-Interim-Interval := 60<br> Framed-Compression := Van-Jacobson-TCP-IP<br> Service-Type := Framed-User<br> Framed-Protocol := PPP<br>
Idle-Timeout := 300<br> Mikrotik-Rate-Limit := "512k/1024k 1024k/2048k 512k/512k 30/30 1"<br> Framed-IP-Netmask := 255.255.255.255<br> Session-Timeout = 10<br> Framed-IP-Address = 192.168.1.20<br>
Finished request 0.<br>Going to the next request<br>Waking up in 4.9 seconds.<br>Cleaning up request 0 ID 39 with timestamp +2<br>Ready to process requests.<br><br><br><br><br><br>Debug Log for Max-Monthly-Session<br><br>
Listening on authentication address * port 1812<br>Listening on accounting address * port 1813<br>Listening on proxy address * port 1814<br>Ready to process requests.<br>rad_recv: Access-Request packet from host 122.175.85.117 port 26199, id=40, length=59<br>
User-Name = "suman"<br> User-Password = "duman12"<br> Calling-Station-Id = "001122334455"<br>+- entering group authorize {...}<br>++[preprocess] returns ok<br>++[chap] returns noop<br>
++[mschap] returns noop<br>[suffix] No '@' in User-Name = "suman", looking up realm NULL<br>[suffix] No such realm "NULL"<br>++[suffix] returns noop<br>[eap] No EAP-Message, not doing EAP<br>++[eap] returns noop<br>
++[unix] returns notfound<br>++[files] returns noop<br>[sql] expand: %{User-Name} -> suman<br>[sql] sql_set_user escaped user --> 'suman'<br>rlm_sql (sql): Reserving sql socket id: 3<br>[sql] expand: SELECT id, username, attribute, value, op FROM tbl_check WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM tbl_check WHERE username = 'suman' ORDER BY id<br>
[sql] User found in radcheck table<br>[sql] expand: SELECT id, username, attribute, value, op FROM tbl_reply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM tbl_reply WHERE username = 'suman' ORDER BY id<br>
[sql] expand: SELECT groupname FROM tbl_usergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM tbl_usergroup WHERE username = 'suman' ORDER BY priority<br>
[sql] expand: SELECT id, groupname, attribute, Value, op FROM tbl_groupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM tbl_groupcheck WHERE groupname = 'Biz1Mbps-UL' ORDER BY id<br>
[sql] User found in group Biz1Mbps-UL<br>[sql] expand: SELECT id, groupname, attribute, value, op FROM tbl_groupreply WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, value, op FROM tbl_groupreply WHERE groupname = 'Biz1Mbps-UL' ORDER BY id<br>
rlm_sql (sql): Released sql socket id: 3<br>++[sql] returns ok<br>rlm_sqlcounter: Entering module authorize code<br>rlm_sqlcounter: Could not find Check item value pair<br>++[noresetcounter] returns noop<br>rlm_sqlcounter: Entering module authorize code<br>
sqlcounter_expand: 'SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800''<br>
[monthlycounter] expand: SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800' -> SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800'<br>
sqlcounter_expand: '%{sql:SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800'}'<br>
[monthlycounter] sql_xlat<br>[monthlycounter] expand: %{User-Name} -> suman<br>[monthlycounter] sql_set_user escaped user --> 'suman'<br>[monthlycounter] expand: SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800' -> SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800'<br>
rlm_sql (sql): Reserving sql socket id: 2<br>rlm_sql_mysql: MYSQL check_error: 1146 received<br>rlm_sql (sql): database query error, SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800': Table 'rdscrm.radacct' doesn't exist<br>
rlm_sql (sql): Released sql socket id: 2<br>[monthlycounter] expand: %{sql:SELECT SUM(acctsessiontime - GREATEST((1298917800 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='suman' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1298917800'} -><br>
rlm_sqlcounter: No integer found in string ""<br>++[monthlycounter] returns noop<br>rlm_sqlcounter: Entering module authorize code<br>rlm_sqlcounter: Could not find Check item value pair<br>++[dailycounter] returns noop<br>
rlm_counter: Entering module authorize code<br>rlm_counter: Could not find Check item value pair<br>++[daily] returns noop<br>rlm_checkval: Item Name: Calling-Station-Id, Value: 001122334455<br>rlm_checkval: Value Name: Calling-Station-Id, Value: 001122334455<br>
++[checkval] returns ok<br>[expiration] Checking Expiration time: '05 Mar 2012 23:59:59'<br>++[expiration] returns ok<br>++[logintime] returns noop<br>++[pap] returns updated<br>Found Auth-Type = PAP<br>+- entering group PAP {...}<br>
[pap] login attempt with password "duman12"<br>[pap] Using CRYPT encryption.<br>[pap] User authenticated successfully<br>++[pap] returns ok<br>+- entering group session {...}<br>[radutmp] expand: /var/log/freeradius/radutmp -> /var/log/freeradius/radutmp<br>
[radutmp] expand: %{User-Name} -> suman<br>++[radutmp] returns ok<br>+- entering group post-auth {...}<br>rlm_sql (sql): Reserving sql socket id: 1<br>[sqlippool] expand: %{User-Name} -> suman<br>[sqlippool] sql_set_user escaped user --> 'suman'<br>
[sqlippool] expand: START TRANSACTION -> START TRANSACTION<br>[sqlippool] expand: UPDATE tbl_ippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '%{Nas-IP-Address}' -> UPDATE tbl_ippool SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', expiry_time = NULL WHERE expiry_time <= NOW() - INTERVAL 1 SECOND AND nasipaddress = '122.175.85.117'<br>
[sqlippool] expand: SELECT framedipaddress FROM tbl_ippool WHERE pool_name = '%{control:Pool-Name}' AND expiry_time IS NULL ORDER BY RAND() LIMIT 1 FOR UPDATE -> SELECT framedipaddress FROM tbl_ippool WHERE pool_name = 'main_pool' AND expiry_time IS NULL ORDER BY RAND() LIMIT 1 FOR UPDATE<br>
[sqlippool] expand: UPDATE tbl_ippool SET nasipaddress = '%{NAS-IP-Address}', pool_key = '%{NAS-Port}', callingstationid = '%{Calling-Station-Id}', username = '%{User-Name}', expiry_time = NOW() + INTERVAL 180 SECOND WHERE framedipaddress = '192.168.1.28' AND expiry_time IS NULL -> UPDATE tbl_ippool SET nasipaddress = '122.175.85.117', pool_key = '', callingstationid = '001122334455', username = 'suman', expiry_time = NOW() + INTERVAL 180 SECOND WHERE framedipaddress = '192.168.1.28' AND expiry_time IS NULL<br>
[sqlippool] Allocated IP 192.168.1.28 [1c01a8c0]<br>[sqlippool] expand: COMMIT -> COMMIT<br>rlm_sql (sql): Released sql socket id: 1<br>[sqlippool] expand: Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name}) -> Allocated IP: 192.168.1.28 from main_pool (did cli 001122334455 port user suman)<br>
Allocated IP: 192.168.1.28 from main_pool (did cli 001122334455 port user suman)<br>++[sqlippool] returns ok<br>[reply_log] expand: /var/log/freeradius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d -> /var/log/freeradius/radacct/<a href="http://122.175.85.117/reply-detail-20110312" target="_blank">122.175.85.117/reply-detail-20110312</a><br>
[reply_log] /var/log/freeradius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d expands to /var/log/freeradius/radacct/<a href="http://122.175.85.117/reply-detail-20110312" target="_blank">122.175.85.117/reply-detail-20110312</a><br>
[reply_log] expand: %t -> Sat Mar 12 16:19:47 2011<br>
++[reply_log] returns ok<br>[sql] expand: %{User-Name} -> suman<br>[sql] sql_set_user escaped user --> 'suman'<br>[sql] expand: %{User-Password} -> duman12<br>[sql] expand: INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( '%{User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S') -> INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( 'suman', 'duman12', 'Access-Accept', '2011-03-12 16:19:47')<br>
rlm_sql (sql) in sql_postauth: query is INSERT INTO tbl_postauth (username, pass, reply, authdate) VALUES ( 'suman', 'duman12', 'Access-Accept', '2011-03-12 16:19:47')<br>
rlm_sql (sql): Reserving sql socket id: 0<br>rlm_sql (sql): Released sql socket id: 0<br>++[sql] returns ok<br>++[exec] returns noop<br>Sending Access-Accept of id 40 to 122.175.85.117 port 26199<br> Framed-MTU := 1472<br>
Reply-Message := "Welcome to Internet Services"<br> Acct-Interim-Interval := 60<br> Framed-Compression := Van-Jacobson-TCP-IP<br> Service-Type := Framed-User<br> Framed-Protocol := PPP<br>
Idle-Timeout := 300<br> Mikrotik-Rate-Limit := "512k/1024k 1024k/2048k 512k/512k 30/30 1"<br> Framed-IP-Netmask := 255.255.255.255<br> Session-Timeout = 31045212<br> Framed-IP-Address = 192.168.1.28<br>
Finished request 0.<br>Going to the next request<br>Waking up in 4.9 seconds.<br>Cleaning up request 0 ID 40 with timestamp +2<br>Ready to process requests.<br><br><br><br><br><br><br><br><br><br>
</blockquote></div><br>