gigawords and bandwith
Lars
eaglelw at gmx.de
Wed Mar 18 12:39:24 CET 2009
Hi,
i'm new here and i need your help in the following 2 points.
Point 1: Acct-Input/Output-Gigawords
Point 2: Bandwithlimit with PPP and PPPoE
My system: debian with kernel 2.6.8-2-386, Roaring Penguin PPPoE Version
3.10, PPP 2.4.4 (not quit sure) and MySQL 4.1.10a.
Point 1) After I recognized that the accounting data
(acct-input/output-octet) will set to zero if the user downloaded more than
4 GB I added to sql.conf and to table radacct the parameter
acct-input/output-gigawords. But It won't be filled with data, it's always
zero.
The sql statements look like this ({acct_table1} and {acct_table2} are both
radacct)
accounting_update_query = "UPDATE ${acct_table1} \
SET FramedIPAddress = '%{Framed-IP-Address}', \
AcctSessionTime = '%{Acct-Session-Time}', \
AcctInputOctets = '%{Acct-Input-Gigawords:-0}' <<
32 | '%{Acct-Input-Octets:-0}', \
AcctOutputOctets = '%{Acct-Output-Gigawords:-0}' <<
32 | '%{Acct-Output-Octets:-0}' \
WHERE AcctSessionId = '%{Acct-Session-Id}' \
AND UserName = '%{SQL-User-Name}' \
AND NASIPAddress= '%{NAS-IP-Address}'"
accounting_stop_query = "UPDATE ${acct_table2} \
SET AcctStopTime = '%S', \
AcctSessionTime = '%{Acct-Session-Time}', \
AcctInputOctets = '%{Acct-Input-Gigawords:-0}' <<
32 | '%{Acct-Input-Octets:-0}', \
AcctOutputOctets = '%{Acct-Output-Gigawords:-0}' <<
32 | '%{Acct-Output-Octets:-0}', \
AcctTerminateCause = '%{Acct-Terminate-Cause}', \
AcctStopDelay = '%{Acct-Delay-Time}', \
ConnectInfo_stop = '%{Connect-Info}' \
WHERE AcctSessionId = '%{Acct-Session-Id}' \
AND UserName = '%{SQL-User-Name}' \
AND NASIPAddress = '%{NAS-IP-Address}'"
accounting_stop_query_alt = "INSERT into ${acct_table2} \
(AcctSessionId, AcctUniqueId, UserName, Realm,
NASIPAddress, \
NASPortId, NASPortType, AcctStartTime, AcctStopTime,
AcctSessionTime, \
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop,
AcctInputOctets, \
AcctOutputOctets, CalledStationId, CallingStationId,
AcctTerminateCause, \
ServiceType, FramedProtocol, FramedIPAddress,
AcctStartDelay, AcctStopDelay) \
values('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', \
'%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}',
'%{NAS-Port-Type}', \
DATE_SUB('%S', INTERVAL (%{Acct-Session-Time:-0} +
%{Acct-Delay-Time:-0}) SECOND), \
'%S', '%{Acct-Session-Time}', '%{Acct-Authentic}',
'', '%{Connect-Info}', \
'%{Acct-Input-Gigawords:-0}' << 32 |
'%{Acct-Input-Octets:-0}', \
'%{Acct-Output-Gigawords:-0}' << 32 |
'%{Acct-Output-Octets:-0}', \
'%{Called-Station-Id}', '%{Calling-Station-Id}',
'%{Acct-Terminate-Cause}', \
'%{Service-Type}', '%{Framed-Protocol}',
'%{Framed-IP-Address}', '0', '%{Acct-Delay-Time}')"
accounting_update_query_alt = "INSERT into ${acct_table1} \
(AcctSessionId, AcctUniqueId, UserName, Realm,
NASIPAddress, \
NASPortId, NASPortType, AcctStartTime,
AcctSessionTime, \
AcctAuthentic, ConnectInfo_start, AcctInputOctets,
AcctOutputOctets, \
CalledStationId, CallingStationId, ServiceType,
FramedProtocol, \
FramedIPAddress, AcctStartDelay)
values('%{Acct-Session-Id}', \
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}',
'%{Realm}', \
'%{NAS-IP-Address}', '%{NAS-Port}',
'%{NAS-Port-Type}', \
DATE_SUB('%S',INTERVAL (%{Acct-Session-Time:-0} +
%{Acct-Delay-Time:-0}) SECOND), \
'%{Acct-Session-Time}', '%{Acct-Authentic}', '', \
'%{Acct-Input-Gigawords:-0}' << 32 |
'%{Acct-Input-Octets:-0}', \
'%{Acct-Output-Gigawords:-0}' << 32 |
'%{Acct-Output-Octets:-0}', \
'%{Called-Station-Id}', '%{Calling-Station-Id}',
'%{Service-Type}', \
'%{Framed-Protocol}', '%{Framed-IP-Address}', '0')"
Point 2) I have to limit the user's bandwith so I think about a simple
possibility to do that. The best way imho would be a entry in "radreplay"
for this user. I added there e.g. framed-ip-address.
Is it possible? And if yes: How?
Regards
Lars
More information about the Freeradius-Devel
mailing list