AW: gigawords and bandwith
Lars
eaglelw at gmx.de
Wed Mar 18 14:46:33 CET 2009
What ver of radius u running?
# radiusd -v
radiusd: FreeRADIUS Version 1.0.2, for host , built on May 4 2005 at
22:51:10
Copyright (C) 2000-2003 The FreeRADIUS server project.
Andrew Paternoster
andrew at gpk.net.au
Senior System Engineer
GPK Computers Pty. Ltd.
A.B.N 72 075 618 012
P.O. 407 Mt Evelyn
Melbourne, VIC 3796
Australia
Tel: 1300 854 223
Fax: 1300 854 223
________________________________
-----Original Message-----
From: freeradius-devel-bounces+andrew=gpk.net.au at lists.freeradius.org
[mailto:freeradius-devel-bounces+andrew=gpk.net.au at lists.freeradius.org] On
Behalf Of Lars
Sent: Wednesday, 18 March 2009 10:39 PM
To: freeradius-devel at lists.freeradius.org
Subject: gigawords and bandwith
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
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/devel.html
More information about the Freeradius-Devel
mailing list