Re: reset sql counter every 30 minute

2011-01-27 Thread Bishal Pun
You can use Session-Timeout attribute in your radreply sql table like:

+-+---+-++-+---+
| id  | UserName  | Attribute   | op | Value   |
+-+---+-++-+---+
|  | 257 | test  | Session-Timeout | := | 1800|
+-+---+-++-+---+


Regards
Bishal

On Thu, Jan 27, 2011 at 1:34 PM, piston  wrote:

> Hi
>
> Is that possible to reset the sql counter every 30 minute?
>
> Basically, i need to get user free access of 20 minutes, after 20 minutes
> NAS will logout the user.
>
> And the user is allow to login again after 30 minute.
>
> Thanks
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Deleting stale session automatically with unlang

2011-01-15 Thread Bishal Pun
Hello Eddie,

 Thanks for the help at last deleting the space from sql: Update section did
the tricks.

Thank you all for help.


Thank you
On Sat, Jan 15, 2011 at 1:00 PM, Eddie Stassen  wrote:

> I should not give that error according to the source. It definitely
> works in the latest version.  Perhaps its the space between 'sql:' and
> 'UPDATE' that is preventing the parser from recognising it as a
> non-select query.  Try removing it?
>
> On Sat, Jan 15, 2011 at 4:02 AM, Bishal Pun  wrote:
> > Hello Edi,
> >  Enclosing sql statement inside empty if gives same error:
> >
> > if(User-Name){
> > if("%{sql: UPDATE radacct set
> > AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
> > AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}'
> and
> > CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){
> > }
> > }
> > Sat Jan 15 07:43:33 2011 : Auth: Login OK: [test] (from client nagios
> port
> > 0)
> > Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL Error: No Fields
> > Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL error:
> > Sat Jan 15 07:44:47 2011 : Info: rlm_sql_mysql: Starting connect to MySQL
> > server for #3
> > Sat Jan 15 07:44:47 2011 : Error: rlm_sql (sql): failed after re-connect
> >
> >
> > On Fri, Jan 14, 2011 at 6:19 PM, Eddie Stassen 
> wrote:
> >>
> >> On Fri, Jan 14, 2011 at 1:57 PM, Johan Meiring
> >>  wrote:
> >> > On 2011/01/14 12:50 PM, Bishal Pun wrote:
> >> >>
> >> >> Alan,
> >> >>
> >> >>  While running that command in mysql it clear the session of user.
> But
> >> >> with
> >> >> radius unlang it is giving error in radius log.
> >> >>
> >> >
> >> > I might be wrong, but as far as I know rlm_mysql expects something to
> >> > come
> >> > back from the query.
> >> >
> >> > Can't think of a solution though unless rlm_mysql will allow somehting
> >> > like
> >> >
> >> > "%{sql: SELECT 1; UPDATE radacct set
> >> > AcctStopTime=ADDDATE(AcctStartTime,INTERVAL
> >> > AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session'
> WHERE
> >> > UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}'
> and
> >> > AcctStopTime is null}"
> >> >
> >> > --
> >>
> >> Enclosing the UPDATE in an empty 'if' works:
> >>
> >> if ("%{sql: UPDATE ...}") {
> >> }
> >>
> >> That prevents the rlm_sql_mysql module from looking for returned fields.
> >>
> >> Eddie
> >>
> >> -
> >> List info/subscribe/unsubscribe? See
> >> http://www.freeradius.org/list/users.html
> >
> >
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html
> >
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Deleting stale session automatically with unlang

2011-01-14 Thread Bishal Pun
Hello Edi,
 Enclosing sql statement inside empty if gives same error:

if(User-Name){
if("%{sql: UPDATE radacct set
AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND),
AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and
CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){
}
}
Sat Jan 15 07:43:33 2011 : Auth: Login OK: [test] (from client nagios port
0)
Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL Error: No Fields
Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL error:
Sat Jan 15 07:44:47 2011 : Info: rlm_sql_mysql: Starting connect to MySQL
server for #3
Sat Jan 15 07:44:47 2011 : Error: rlm_sql (sql): failed after re-connect


On Fri, Jan 14, 2011 at 6:19 PM, Eddie Stassen  wrote:

> On Fri, Jan 14, 2011 at 1:57 PM, Johan Meiring
>  wrote:
> > On 2011/01/14 12:50 PM, Bishal Pun wrote:
> >>
> >> Alan,
> >>
> >>  While running that command in mysql it clear the session of user. But
> >> with
> >> radius unlang it is giving error in radius log.
> >>
> >
> > I might be wrong, but as far as I know rlm_mysql expects something to
> come
> > back from the query.
> >
> > Can't think of a solution though unless rlm_mysql will allow somehting
> like
> >
> > "%{sql: SELECT 1; UPDATE radacct set
> > AcctStopTime=ADDDATE(AcctStartTime,INTERVAL
> > AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE
> > UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and
> > AcctStopTime is null}"
> >
> > --
>
> Enclosing the UPDATE in an empty 'if' works:
>
> if ("%{sql: UPDATE ...}") {
> }
>
> That prevents the rlm_sql_mysql module from looking for returned fields.
>
> Eddie
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Re: Deleting stale session automatically with unlang

2011-01-14 Thread Bishal Pun
Alan,

 While running that command in mysql it clear the session of user. But with
radius unlang it is giving error in radius log.

Thanks

On Fri, Jan 14, 2011 at 3:41 PM, Alan DeKok wrote:

> Bishal Pun wrote:
>
> > if(User-Name){
> > "%{sql: UPDATE radacct set AcctStopTime=ADDDATE(AcctStartTime,INTERVAL
> > AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE
> > UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and
> > AcctStopTime is null}"
> > }
>
>   That should work, barring SQL issues.
>
> > but it doesn't help me, giving me error like
> > Wed Jan 12 15:16:14 2011 : Error: rlm_sql_mysql: MYSQL Error: No Fields
>
>   That's a MySQL issue.
>
> > any help?
>
>  Can you run the command from the mysql client?  i.e. without RADIUS
> being involved?
>
>  Alan DeKok.
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Deleting stale session automatically with unlang

2011-01-13 Thread Bishal Pun
+Hi ,

 I am using freeradius 2.1.6 + mysql + LDAP for AAA in freebsd server. What
I want to do is, when my AP reboots or due to power failure clients login is
still seen there as online but the client is not able to do login. SO is it
possible to clear the stale session with unlang if the authentication
request come from same calling station id? I tried to do in
/etc/freeradius/sites-enable/default  authorize section

if(User-Name){
"%{sql: UPDATE radacct set AcctStopTime=ADDDATE(AcctStartTime,INTERVAL
AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE
UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and
AcctStopTime is null}"
}

but it doesn't help me, giving me error like
Wed Jan 12 15:16:14 2011 : Error: rlm_sql_mysql: MYSQL Error: No Fields
Wed Jan 12 15:16:14 2011 : Error: rlm_sql_mysql: MYSQL error:
Wed Jan 12 15:16:14 2011 : Info: rlm_sql_mysql: Starting connect to MySQL
server for #4
Wed Jan 12 15:16:14 2011 : Error: rlm_sql (sql): failed after re-connect

any help?
thank you
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Acct-Interim-Interval not working

2010-07-20 Thread Bishal

Hello all,

 I am using freeradius 2.1.6 on FreeBSD 7.2 and using rp-pppoe server
3.10 on gentoo linux. During live session it is not updating
acct-input/ouput-octets. Earlier with mpd pppoe server on freebsd it was
working fine accounting input and output octets were updating every
5mins as configured in mpd server but now I have migrated my pppoe
server to rp-pppoe and it's not updating account values. I have set in
radgroupreply table as:

 34 | Unlimited Premium   | Acct-Interim-Interval | := | 300
| 35 | Unlimited Premium   | Acct-Status-Type  | := |
Interim-Update

I want to create mrtg graph of users online but due to this problem I am
not able to. Any help?

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Max-All-Session counter module problem[SOLVED]

2009-08-30 Thread Bishal Pun

Hello all,

Problem is solved. Actually it was due to radgroupcheck table. There I have 
inserted Max-All-Session as 9. I deleted it and now the user can log in.


Thank you
Bishal






Hi,

I am posting the debug of another user who has same problem:

rad_recv: Access-Request packet from host 202.79.xx.XX port 65050,
id=12, length=189
  NAS-Identifier = "pppoe-bhw."
  Acct-Session-Id = "1633129-mpd-pppoe-70"
  NAS-Port = 70
  NAS-Port-Type = Ethernet
  Service-Type = Framed-User
  Framed-Protocol = PPP
  Calling-Station-Id = "0016768aaa28"
  Called-Station-Id = "WIFITEST"
  NAS-Port-Id = "rl0"
  Vendor-12341-Attr-12 = 0x6d70642d7070706f652d3730
  Tunnel-Medium-Type:0 = IEEE-802
  Tunnel-Client-Endpoint:0 = "00:16:76:8a:aa:28"
  User-Name = "sneha"
  User-Password = "123"
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "sneha", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[sql]   expand: %{User-Name} -> sneha
[sql] sql_set_user escaped user --> 'sneha'
rlm_sql (sql): Reserving sql socket id: 1
[sql]   expand: SELECT id, username, attribute, value, op   FROM
radcheck   WHERE username = '%{SQL-User-Name}'   ORDER
BY id -> SELECT id, username, attribute, value, op   FROM
radcheck   WHERE username = 'sneha'   ORDER BY id
[sql] User found in radcheck table
[sql]   expand: SELECT id, username, attribute, value, op   FROM
radreply   WHERE username = '%{SQL-User-Name}'   ORDER
BY id -> SELECT id, username, attribute, value, op   FROM
radreply   WHERE username = 'sneha'   ORDER BY id

[sql] expand: SELECT groupname FROM radusergroup WHERE username = 
'%{SQL-User-Name}' ORDER BY priority ->


SELECT groupname   FROM radusergroup   WHERE username =
'sneha'   ORDER BY priority
[sql]   expand: SELECT id, groupname, attribute,   Value,
op   FROM radgroupcheck   WHERE groupname =
'%{Sql-Group}'   ORDER BY id -> SELECT id, groupname,

attribute, Value, op FROM radgroupcheck WHERE groupname = 'Prepaid 
Hours' ORDER BY id


[sql] User found in group Prepaid Hours
[sql]   expand: SELECT id, groupname, attribute,   value,
op   FROM radgroupreply   WHERE groupname =
'%{Sql-Group}'   ORDER BY id -> SELECT id, groupname,

attribute, value, op FROM radgroupreply WHERE groupname = 'Prepaid 
Hours' ORDER BY id


rlm_sql (sql): Released sql socket id: 1
++[sql] returns ok
[ldap] performing user authorization for sneha
[ldap] WARNING: Deprecated conditional expansion ":-".  See "man unlang"
for details
[ldap]  expand: (cn=%{Stripped-User-Name:-%{User-Name}}) -> (cn=sneha)
[ldap]  expand: ou=users,ou=radius,dc=resunganet,dc=com,dc=np ->
ou=users,ou=radius,dc=resunganet,dc=com,dc=np
rlm_ldap: ldap_get_conn: Checking Id: 0
rlm_ldap: ldap_get_conn: Got Id: 0
rlm_ldap: performing search in
ou=users,ou=radius,dc=resunganet,dc=com,dc=np, with filter (cn=sneha)
[ldap] checking if remote access for sneha is allowed by dialupAccess
[ldap] Added User-Password = {SSHA}zG7/cgoBWWNIVo7WtLMria1ui7GJAztI in
check items
[ldap] looking for check items in directory...
[ldap] looking for reply items in directory...
[ldap] user sneha authorized to use remote access
rlm_ldap: ldap_release_conn: Release Id: 0
++[ldap] returns ok
rlm_sqlcounter: Entering module authorize code
sqlcounter_expand:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='%{User-Name}''
[noresetcounter]expand: SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='%{User-Name}' -> SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='sneha'
sqlcounter_expand:  '%{sql:SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='sneha'}'
[noresetcounter] sql_xlat
[noresetcounter]expand: %{User-Name} -> sneha
[noresetcounter] sql_set_user escaped user --> 'sneha'
[noresetcounter]expand: SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='sneha' -> SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='sneha'
rlm_sql (sql): Reserving sql socket id: 0
[noresetcounter] sql_xlat finished
rlm_sql (sql): Released sql socket id: 0
[noresetcounter]expand: %{sql:SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='sneha'} -> 90001
rlm_sqlcounter: (Check item - counter) is less than zero
rlm_sqlcounter: Rejected user sneha, check_item=9, counter=90001
++[noresetcounter] returns reject
Invalid user (rlm

Max-All-Session counter module problem

2009-08-29 Thread Bishal Pun

Hi,

I am posting the debug of another user who has same problem:

rad_recv: Access-Request packet from host 202.79.xx.XX port 65050,
id=12, length=189
   NAS-Identifier = "pppoe-bhw."
   Acct-Session-Id = "1633129-mpd-pppoe-70"
   NAS-Port = 70
   NAS-Port-Type = Ethernet
   Service-Type = Framed-User
   Framed-Protocol = PPP
   Calling-Station-Id = "0016768aaa28"
   Called-Station-Id = "WIFITEST"
   NAS-Port-Id = "rl0"
   Vendor-12341-Attr-12 = 0x6d70642d7070706f652d3730
   Tunnel-Medium-Type:0 = IEEE-802
   Tunnel-Client-Endpoint:0 = "00:16:76:8a:aa:28"
   User-Name = "sneha"
   User-Password = "123"
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
[suffix] No '@' in User-Name = "sneha", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[sql]   expand: %{User-Name} -> sneha
[sql] sql_set_user escaped user --> 'sneha'
rlm_sql (sql): Reserving sql socket id: 1
[sql]   expand: SELECT id, username, attribute, value, op   FROM
radcheck   WHERE username = '%{SQL-User-Name}'   ORDER
BY id -> SELECT id, username, attribute, value, op   FROM
radcheck   WHERE username = 'sneha'   ORDER BY id
[sql] User found in radcheck table
[sql]   expand: SELECT id, username, attribute, value, op   FROM
radreply   WHERE username = '%{SQL-User-Name}'   ORDER
BY id -> SELECT id, username, attribute, value, op   FROM
radreply   WHERE username = 'sneha'   ORDER BY id
[sql]   expand: SELECT groupname   FROM radusergroup  
WHERE username = '%{SQL-User-Name}'   ORDER BY priority ->

SELECT groupname   FROM radusergroup   WHERE username =
'sneha'   ORDER BY priority
[sql]   expand: SELECT id, groupname, attribute,   Value,
op   FROM radgroupcheck   WHERE groupname =
'%{Sql-Group}'   ORDER BY id -> SELECT id, groupname,
attribute,   Value, op   FROM radgroupcheck  
WHERE groupname = 'Prepaid Hours'   ORDER BY id

[sql] User found in group Prepaid Hours
[sql]   expand: SELECT id, groupname, attribute,   value,
op   FROM radgroupreply   WHERE groupname =
'%{Sql-Group}'   ORDER BY id -> SELECT id, groupname,
attribute,   value, op   FROM radgroupreply  
WHERE groupname = 'Prepaid Hours'   ORDER BY id

rlm_sql (sql): Released sql socket id: 1
++[sql] returns ok
[ldap] performing user authorization for sneha
[ldap] WARNING: Deprecated conditional expansion ":-".  See "man unlang"
for details
[ldap]  expand: (cn=%{Stripped-User-Name:-%{User-Name}}) -> (cn=sneha)
[ldap]  expand: ou=users,ou=radius,dc=resunganet,dc=com,dc=np ->
ou=users,ou=radius,dc=resunganet,dc=com,dc=np
rlm_ldap: ldap_get_conn: Checking Id: 0
rlm_ldap: ldap_get_conn: Got Id: 0
rlm_ldap: performing search in
ou=users,ou=radius,dc=resunganet,dc=com,dc=np, with filter (cn=sneha)
[ldap] checking if remote access for sneha is allowed by dialupAccess
[ldap] Added User-Password = {SSHA}zG7/cgoBWWNIVo7WtLMria1ui7GJAztI in
check items
[ldap] looking for check items in directory...
[ldap] looking for reply items in directory...
[ldap] user sneha authorized to use remote access
rlm_ldap: ldap_release_conn: Release Id: 0
++[ldap] returns ok
rlm_sqlcounter: Entering module authorize code
sqlcounter_expand:  'SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='%{User-Name}''
[noresetcounter]expand: SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='%{User-Name}' -> SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='sneha'
sqlcounter_expand:  '%{sql:SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='sneha'}'
[noresetcounter] sql_xlat
[noresetcounter]expand: %{User-Name} -> sneha
[noresetcounter] sql_set_user escaped user --> 'sneha'
[noresetcounter]expand: SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='sneha' -> SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='sneha'
rlm_sql (sql): Reserving sql socket id: 0
[noresetcounter] sql_xlat finished
rlm_sql (sql): Released sql socket id: 0
[noresetcounter]expand: %{sql:SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='sneha'} -> 90001
rlm_sqlcounter: (Check item - counter) is less than zero
rlm_sqlcounter: Rejected user sneha, check_item=9, counter=90001
++[noresetcounter] returns reject
Invalid user (rlm_sqlcounter: Maximum never usage time reached): [sneha]
(from client pppoe-bhw 

Re: Insert billiplan code in radacct table during authenticaiton

2008-10-27 Thread Bishal

Hi Liran,

 I have developed my own php based online viewing gui interface.


Bishal

On 10/27/2008, "liran tal" <[EMAIL PROTECTED]> wrote:

>On Sun, Oct 26, 2008 at 4:12 AM, Bishal <[EMAIL PROTECTED]> wrote:
>
>>
>> Following is my radcheck table format:
>>
>> --+--+-+--+
>> | id   | UserName | Attribute| op | Value| CrDate
>> | creator | Usemac | activated | activeDate  | status |
>> rate | Type | BillingPlan | TimeToFinish |
>>
>> +--+--+--++--+-+-++---+-----++--+--+-+--+
>> | 1272 | bishal   | User-Password| == | testpass| 2006-07-28
>> 18:42:58 | bishal  |  0 | 0 | 2007-07-22 20:49:17 |  0 |
>>   0 |  |   001 |    0 |
>> | 1273 |  Hary | User-Password  | == | lamp   | 2007-08-28 20:443:58
>> | bishal | 0| 0 |  2007-08-28 20:443:58 | 0   |0 |
>> |   002 |0|
>> =
>>
>>
>Yickes!
>Why would anyone torture radcheck table like that? :-)
>
>I'm curious to know which management application you are using if it's ok
>for you to let us know.
>
>
>Regards,
>Liran.
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Insert billiplan code in radacct table during authenticaiton

2008-10-26 Thread Bishal

Thanks Ivan, by extending my query in mysql it worked.

Thanks
Bishal

On 10/26/2008, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

>>Following is my radcheck table format:
>>
>>--+--+-+--+
>>| id   | UserName | Attribute| op | Value| CrDate
>> | creator | Usemac | activated | activeDate  | status |
>>rate | Type | BillingPlan | TimeToFinish |
>>+--+--+--++--+-+-++---+-+----+------+--+-+--+
>>| 1272 | bishal   | User-Password| == | testpass| 2006-07-28
>>18:42:58 | bishal  |  0 | 0 | 2007-07-22 20:49:17 |  0 |
>>   0 |  |   001 |0 |
>>| 1273 |  Hary | User-Password  | == | lamp   | 2007-08-28 20:443:58
>>| bishal | 0| 0 |  2007-08-28 20:443:58 | 0   |0 |
>>|   002 |0|
>>=
>>
>>My scenario is I have two office and each office using same NAS to
>>connect to internet.
>>
>>Office A users:  Office B Users
>>bishal Hary
>>stephe   Mic
>>john   test
>>
>>My question is if Office A support staff want to view the online users
>>then he should not be able to view office B users online. In the same
>>way office B staff should not be able to view Office A users online. I
>>know if I use different NAs then it's possbile. is it possible by using
>>same NAS with the help of mysql?
>>
>
>This is absolutely nothing to do with freeradius. It's user management.
>Your appication that handles that is suposed to do these things.
>Simplest way is to extend the query:
>
>>>Let's not. Use sql query to view online users with billing plan:
>>>
>>>SELECT radacct.*,radcheck.Billingplan FROM radacct,radcheck WHERE
>>>radacct.AcctStopTime IS NULL (or =0 for older schema) AND
>>>radacct.UserName=radcheck.UserName AND radcheck.Attribute='Billingplan'
>
>add AND radcheck.BillingPlan='001' for users from officeA and '002'
>for users from officeB. Your application will have to know who is the
>user using it (ie. they will have to log into it).
>
>Ivan Kalik
>Kalik Informatika ISP
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Insert billiplan code in radacct table during authenticaiton

2008-10-25 Thread Bishal

Following is my radcheck table format:

--+--+-+--+
| id   | UserName | Attribute| op | Value| CrDate
 | creator | Usemac | activated | activeDate  | status |
rate | Type | BillingPlan | TimeToFinish |
+--+--+--++--+-+-++---+-++--+--+-+--+
| 1272 | bishal   | User-Password| == | testpass| 2006-07-28
18:42:58 | bishal  |  0 | 0 | 2007-07-22 20:49:17 |  0 |
   0 |  |   001 |0 |
| 1273 |  Hary | User-Password  | == | lamp   | 2007-08-28 20:443:58
| bishal | 0| 0 |  2007-08-28 20:443:58 | 0   |0 |
|   002 |0|
=

My scenario is I have two office and each office using same NAS to
connect to internet.

Office A users:  Office B Users
bishal Hary
stephe   Mic
john   test

My question is if Office A support staff want to view the online users
then he should not be able to view office B users online. In the same
way office B staff should not be able to view Office A users online. I
know if I use different NAs then it's possbile. is it possible by using
same NAS with the help of mysql?

Thank you
Bishal
On 10/25/2008, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

>>   I am using freeradius for AAA of my cable users. Now what I want
>>to do is, insert billiplan code 001 into radacct table during
>>authentication so that I can view online users according to billingplan
>>code. There will be Billingplan field in radcheck table and when users
>>tries to login the script will check the radcheck table and update that
>>billingplan code into radacct table.
>
>Let's not. Use sql query to view online users with billing plan:
>
>SELECT radacct.*,radcheck.Billingplan FROM radacct,radcheck WHERE
>radacct.AcctStopTime IS NULL (or =0 for older schema) AND
>radacct.UserName=radcheck.UserName AND radcheck.Attribute='Billingplan'
>
>Ivan Kalik
>Kalik Informatika ISP
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Insert billiplan code in radacct table during authenticaiton

2008-10-24 Thread Bishal

Hi all,

   I am using freeradius for AAA of my cable users. Now what I want
to do is, insert billiplan code 001 into radacct table during
authentication so that I can view online users according to billingplan
code. There will be Billingplan field in radcheck table and when users
tries to login the script will check the radcheck table and update that
billingplan code into radacct table.
 Is it possible with rlm_perl module?

Thank you
Bishal

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: help need with mysql statement in freeradius

2008-05-17 Thread Bishal

Hi all,

 After many trial and errors my perl modules is working great. Thanks
IVan, Alan and all of who helped me a lot. Well I am not programmer but
search in google and you guys helped me a lot.
 One thing is I am not able to log my custom message of perl modules in
radius.log. Is it possible to show the custom log message in radius.log

sub authorize{
  if ( $mac == 1 && $RAD_CHECK{'Calling-Station-Id'} eq ""){
my $sql2 = $dbh->prepare("INSERT INTO radcheck
(id,username,attribute,op,value)
VALUES('','$RAD_REQUEST{'User-Name'}','Calling
-Station-Id','+=','$RAD_REQUEST{'Calling-Station-Id'}')");
$rowcount = $sql2->execute();
#or die "Cannot execute SQL Statement: $DBI::errstr\n";
   $RAD_REPLY{'Reply-Message'} = "Mac Address Successfully
updated in database $RAD_REQUEST{'Calling-Station-Id'}";
   return RLM_MODULE_OK;

   # Do some logging.
   &radiusd::radlog(1,"rlm_perl:: NEW MAC updated in database.");
}




>request (ie. mobile). Same applies to $sql3. Also I would use == instead
>of += as the operator there.

I am using += operator because it helps me to store multiple CID in
database and also after using this operator it logs the correct
information in radius.log like why user are being reject. Before I was
using == but it only gives Login incorrect.


>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: help need with mysql statement in freeradius

2008-05-15 Thread Bishal
meout = 200
rlm_perl: Added pair mpd-filter = 1#1=match dst 202.xx.xx.xx
rlm_perl: Added pair mpd-filter = 2#1=match src 202.xx.xx.xx
rlm_perl: Added pair Framed-Compression = Van-Jacobson-TCP-IP
rlm_perl: Added pair Expiration = Jul  3 2008 00:00:00 NPT
rlm_perl: Added pair Max-All-Session = 42
rlm_perl: Added pair User-Password = computer
rlm_perl: Added pair Simultaneous-Use = 2
rlm_perl: Added pair Auth-Type = CHAP
  modcall[authorize]: module "perl" returns reject for request 0
modcall: leaving group authorize (returns reject) for request 0
Invalid user: [mobile] (from client pppoe-test port 12 cli 001a4daf4ead)


In radiusd.conf

perl {
module = /usr/local/etc/raddb/mac_check.pl

   #  List of functions in the module to call.
   #  Comment out and change if you want to use other
   #  function names than the defaults.
   #
   #func_authenticate = authenticate
   func_authorize = authorize
   #func_preacct = preacct
   #func_accounting = accounting
   #func_checksimul = checksimul
   #func_pre_proxy = pre_proxy
   #func_post_proxy = post_proxy
   #func_post_auth = post_auth
   #func_xlat = xlat
   #func_detach = detach
   #func_start_accounting = accounting_start
   #func_stop_accounting = accounting_stop
   }

authorize {

  checkval
dailycounter
monthlycounter
noresetcounter
perl
}

=
sniplet of mac_check.pl

==
#!/usr/bin/perl
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);


$username = $RAD_REQUEST{'User-Name'};
$callerid = $RAD_REQUEST{'Calling-Station-Id'};


use DBI;


$database = "radius";
$user = "freeradius";
$password = "blabar2";
$option = "localhost";

$dsn = "DBI:mysql:$database";
$dsn = "DBI:mysql:database=$database;$option";
$dbh = DBI->connect($dsn, $user, $password);

my $sql = $dbh->prepare( "SELECT Usemac FROM radcheck WHERE
UserName='$username' AND Attribute='Expiration' ");
my $sql2 = $dbh->prepare( "SELECT Value FROM radcheck WHERE
Attribute='Calling-Station-Id' AND UserName='tori' ");
my $sql3 = $dbh->prepare( "INSERT INTO radcheck
(id,UserName,Attribute,op,Value)
VALUES('','$username','Calling-Station-Id','+=','$cal
lerid' ");


$rowcount = $sql->execute
or die "Cannot execute SQL statement: $DBI::errstr\n";

my @row;
while ( @row = $sql->fetchrow_array() ) {
$mac = $row[0];
chomp($mac);
}
sub authorize {
    # Auto assign MAC  on first login if MAC is enabled
if ($mac == 1 ){

$rowcount = $sql3->execute
or die "Cannot execute SQL Statement: $DBI::errstr\n";
return RLM_MODULE_OK;

}else {
# Log  MAC Auth not enabled in radius log
$RAD_REPLY{'Reply-Message'} = "MAC Auth not Enabled";
return RLM_MODULE_OK;
}
}
$sql->finish;
$dbh->disconnect()
or warn "Disconnection failed: $DBI::errstr\n";

=
Any suggestion?

Thank you





On 5/15/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:

>PS. You should run your script in authorize.
>
>Ivan Kalik
>Kalik Informatika ISP
>
>
>Dana 15/5/2008, "Bishal" <[EMAIL PROTECTED]> pi¹e:
>
>>
>>Hello Ivan,
>>
>>  I came up with this scripts but looks like it;s not working. In
>>radiusd.conf
>>
>>perl{
>>  modules = /usr/local/etc/raddb/mac_check.pl
>> }
>>
>>Instantiate {
>>  exec
>>  expr
>> dailycounter
>> noresetcounter
>> perl
>>}
>>
>>radius debug shows perl modules loaded. But my script is not working. How
>>can I assign variables username and callingStationid in my script during
>>authentication process. rlm_perl doc show %RAD_REQUEST{'User-name'}
>>but it's not helping?
>>
>>
>>
>>
>>
>>
>>#!/usr/bin/perl
>># Check for MAC Authentication is enable or not
>>
>>
>>#$username = $ARGV[4];
>>
>>#$username = %RAD_REQUEST{'User-Name'};
>>#$callerid = %RAD_REQUEST{'Calling-Station-Id'};
>>
>>
>>use DBI;
>>
>>
>>
>>$database = "radius";
>>$user = "freeradius";
>>$password = "blaba2r";
>>$option = "localhost";
>>
>>

Re: help need with mysql statement in freeradius

2008-05-15 Thread Bishal

I am getting core dumped while running that script.

rlm_perl: perl_embed:: module = /usr/local/etc/raddb/mac_check.pl , func
= authorize exit status= Undefined subroutine &main::authorize called
Segmentation fault (core dumped)

##Script part
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);



$username = $RAD_REQUEST{'User-Name'};
$callerid = $RAD_REQUEST{'Calling-Station-Id'};

Is this the right process of getting value from the request ? How can I
bypass perl function Authorization, authentication, accounting so that
only MAC assignment process will be done by this script?

Thanks





On 5/15/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:

>PS. You should run your script in authorize.
>
>Ivan Kalik
>Kalik Informatika ISP
>
>
>Dana 15/5/2008, "Bishal" <[EMAIL PROTECTED]> pi¹e:
>
>>
>>Hello Ivan,
>>
>>  I came up with this scripts but looks like it;s not working. In
>>radiusd.conf
>>
>>perl{
>>  modules = /usr/local/etc/raddb/mac_check.pl
>> }
>>
>>Instantiate {
>>  exec
>>  expr
>> dailycounter
>> noresetcounter
>> perl
>>}
>>
>>radius debug shows perl modules loaded. But my script is not working. How
>>can I assign variables username and callingStationid in my script during
>>authentication process. rlm_perl doc show %RAD_REQUEST{'User-name'}
>>but it's not helping?
>>
>>
>>
>>
>>
>>
>>#!/usr/bin/perl
>># Check for MAC Authentication is enable or not
>>
>>
>>#$username = $ARGV[4];
>>
>>#$username = %RAD_REQUEST{'User-Name'};
>>#$callerid = %RAD_REQUEST{'Calling-Station-Id'};
>>
>>
>>use DBI;
>>
>>
>>
>>$database = "radius";
>>$user = "freeradius";
>>$password = "blaba2r";
>>$option = "localhost";
>>
>>$dsn = "DBI:mysql:$database";
>>$dsn = "DBI:mysql:database=$database;$option";
>>$dbh = DBI->connect($dsn, $user, $password);
>>
>>my $sql = $dbh->prepare( "SELECT Usemac FROM radcheck WHERE
>>UserName='$RAD_REQUEST{'User-Name'}' AND Attribute='Expiration'
>>");
>>my $sql2 = $dbh->prepare( "SELECT Value FROM radcheck WHERE
>>Attribute='Calling-Station-Id' AND UserName='tori' ");
>>my $sql3 = $dbh->prepare( "INSERT INTO radcheck
>>(id,UserName,Attribute,op,Value)
>>VALUES('','$RAD_REQUEST{'User-Name'}','Calling-Statio
>>n-Id','+=','$RAD_REQUEST{'Calling-Station-Id'}' ");
>>
>>
>>$rowcount = $sql->execute
>>or die "Cannot execute SQL statement: $DBI::errstr\n";
>>
>>my @row;
>>while ( @row = $sql->fetchrow_array() ) {
>>$mac = $row[0];
>>chomp($mac);
>>}
>># Check if MAC authentication is enabled or not if enabled then insert
>>the mac
>>if ($mac == 1 ){
>>
>>$rowcount = $sql3->execute
>>or die "Cannot execute SQL Statement: $DBI::errstr\n";
>>
>>
>>}else {
>>exit;
>>}
>>$sql->finish;
>>$dbh->disconnect()
>>or warn "Disconnection failed: $DBI::errstr\n";
>>
>>
>>On 5/14/2008, "Bishal" <[EMAIL PROTECTED]> wrote:
>>
>>>
>>>Any sample scripts IVAN?
>>>
>>>
>>>
>>>On 5/14/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:
>>>
>>>>>
>>>>> I am using sql for AAA.
>>>>
>>>>I have news for you - you are not. You are using it to store attributes.
>>>>
>>>>>Can u give me some exaples how can I do that
>>>>>withl Rlm_perl modules.?
>>>>>
>>>>
>>>>Do Google: mysql perl tutorial. If it's not MySQL, replace that with the
>>>>name of your sql server.
>>>>
>>>>Ivan Kalik
>>>>Kalik Informatika ISP
>>>>
>>>>-
>>>>List info/subscribe/unsubscribe? See 
>>>>http://www.freeradius.org/list/users.html
>>>>
>>>>
>>>
>>>-
>>>List info/subscribe/unsubscribe? See 
>>>http://www.freeradius.org/list/users..html
>>>
>>>
>>
>>-
>>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>>
>>
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: help need with mysql statement in freeradius

2008-05-14 Thread Bishal

Hello Ivan,

  I came up with this scripts but looks like it;s not working. In
radiusd.conf

perl{
  modules = /usr/local/etc/raddb/mac_check.pl
 }

Instantiate {
  exec
  expr
 dailycounter
 noresetcounter
 perl
}

radius debug shows perl modules loaded. But my script is not working. How
can I assign variables username and callingStationid in my script during
authentication process. rlm_perl doc show %RAD_REQUEST{'User-name'}
but it's not helping?






#!/usr/bin/perl
# Check for MAC Authentication is enable or not


#$username = $ARGV[4];

#$username = %RAD_REQUEST{'User-Name'};
#$callerid = %RAD_REQUEST{'Calling-Station-Id'};


use DBI;



$database = "radius";
$user = "freeradius";
$password = "blaba2r";
$option = "localhost";

$dsn = "DBI:mysql:$database";
$dsn = "DBI:mysql:database=$database;$option";
$dbh = DBI->connect($dsn, $user, $password);

my $sql = $dbh->prepare( "SELECT Usemac FROM radcheck WHERE
UserName='$RAD_REQUEST{'User-Name'}' AND Attribute='Expiration'
");
my $sql2 = $dbh->prepare( "SELECT Value FROM radcheck WHERE
Attribute='Calling-Station-Id' AND UserName='tori' ");
my $sql3 = $dbh->prepare( "INSERT INTO radcheck
(id,UserName,Attribute,op,Value)
VALUES('','$RAD_REQUEST{'User-Name'}','Calling-Statio
n-Id','+=','$RAD_REQUEST{'Calling-Station-Id'}' ");


$rowcount = $sql->execute
or die "Cannot execute SQL statement: $DBI::errstr\n";

my @row;
while ( @row = $sql->fetchrow_array() ) {
$mac = $row[0];
chomp($mac);
}
# Check if MAC authentication is enabled or not if enabled then insert
the mac
if ($mac == 1 ){

$rowcount = $sql3->execute
or die "Cannot execute SQL Statement: $DBI::errstr\n";


}else {
exit;
}
$sql->finish;
$dbh->disconnect()
or warn "Disconnection failed: $DBI::errstr\n";


On 5/14/2008, "Bishal" <[EMAIL PROTECTED]> wrote:

>
>Any sample scripts IVAN?
>
>
>
>On 5/14/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:
>
>>>
>>> I am using sql for AAA.
>>
>>I have news for you - you are not. You are using it to store attributes.
>>
>>>Can u give me some exaples how can I do that
>>>withl Rlm_perl modules.?
>>>
>>
>>Do Google: mysql perl tutorial. If it's not MySQL, replace that with the
>>name of your sql server.
>>
>>Ivan Kalik
>>Kalik Informatika ISP
>>
>>-
>>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>>
>>
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: help need with mysql statement in freeradius

2008-05-14 Thread Bishal

Any sample scripts IVAN?



On 5/14/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:

>>
>> I am using sql for AAA.
>
>I have news for you - you are not. You are using it to store attributes.
>
>>Can u give me some exaples how can I do that
>>withl Rlm_perl modules.?
>>
>
>Do Google: mysql perl tutorial. If it's not MySQL, replace that with the
>name of your sql server.
>
>Ivan Kalik
>Kalik Informatika ISP
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: help need with mysql statement in freeradius

2008-05-14 Thread Bishal

Hi Ivan,

 I am using sql for AAA. Can u give me some exaples how can I do that
withl Rlm_perl modules.?

Thanks

On 5/14/2008, "Ivan Kalik" <[EMAIL PROTECTED]> wrote:

>http://wiki.freeradius.org/Rlm_perl
>
>Ivan Kalik
>kalik Informatika ISP
>
>
>Dana 14/5/2008, "Bishal" <[EMAIL PROTECTED]> pi¹e:
>
>>
>>Hi all,
>>
>>   I am trying to do MAC insertion during post authentication section
>>with the help of freeradius. Like during authentication section it will
>>check in mysql database for MAC use option. If MAC use= 1 then if the
>>user is login for the first time then grab the mac address from the
>>login process and insert into database. If mac use is not enable i.e.
>>MAC use=0 then go through normal process. Is is possible how can I do
>>that?
>>
>>Thanks in advance
>>
>>-
>>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>>
>>
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


help need with mysql statement in freeradius

2008-05-13 Thread Bishal

Hi all,

   I am trying to do MAC insertion during post authentication section
with the help of freeradius. Like during authentication section it will
check in mysql database for MAC use option. If MAC use= 1 then if the
user is login for the first time then grab the mac address from the
login process and insert into database. If mac use is not enable i.e.
MAC use=0 then go through normal process. Is is possible how can I do
that?

Thanks in advance

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: freeradius authentication LAN users

2007-08-10 Thread Bishal

Use PPPoE for AAA.

Regards
Bisal
On 8/10/2007, "ram" <[EMAIL PROTECTED]> wrote:

>On 8/8/07, satish patel <[EMAIL PROTECTED]> wrote:
>>
>> Dear all
>>
>>  I am on ISP and i want to configure billing gateway
>> means user authentuicate that gateway and surffing net so is these type of
>> any opensource package is available and radius for billing
>>
>> Rgds
>>
>> satish patel
>
>
>
>Look at IPtables and ip accounting
>
>ram
>
>$ cat ~/satish/url.txt
>>
>> http://www.linuxbug.org
>>
>> _
>>
>> --
>> 5, 50, 500, 5000. Store N number of mails in your inbox. Click 
>> here.
>>
>>
>> -
>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>>
>
>

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: LDAP errror in dialup admin page

2007-07-29 Thread Bishal

Apache is running as www and it can open and read file. But still I am
getting the same error.



On 7/29/2007, "Kostas Kalevras" <[EMAIL PROTECTED]> wrote:

>O/H Bishal έγραψε:
>> I am trying to use freeradius 1.1.7 in Freebsd 6.2 with openldap 2.3.37
>> for authentication and mysql for accounting.
>>
>> While creating new user I get following error in dialup admin page:
>>
>> Warning: file(/usr/local/etc/raddb/ldap.attrmap) [function.file]: failed
>> to open stream: Permission denied in
>> /usr/local/www/apache22/data/dialupadmin/lib/ldap/attrmap.php3 on line 4
>>   
>I think the problem is exactly what is written. Check the persmissions 
>to the /usr/local/etc/raddb/ldap.attrmap file. Especially check that the 
>apache process (usually runs as nobody) can open the file.
>> Warning: Invalid argument supplied for foreach() in
>> /usr/local/www/apache22/data/dialupadmin/lib/ldap/attrmap.php3 on line 5
>>
>> - 
>> List info/subscribe/unsubscribe? See 
>> http://www.freeradius.org/list/users.html
>>   
>
>
>-- 
>Kostas Kalevras - Network Operations Center
>National Technical University of Athens
>http://kkalev.wordpress.com
>
>- 
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


LDAP errror in dialup admin page

2007-07-29 Thread Bishal

I am trying to use freeradius 1.1.7 in Freebsd 6.2 with openldap 2.3.37
for authentication and mysql for accounting.

While creating new user I get following error in dialup admin page:

Warning: file(/usr/local/etc/raddb/ldap.attrmap) [function.file]: failed
to open stream: Permission denied in
/usr/local/www/apache22/data/dialupadmin/lib/ldap/attrmap.php3 on line 4

Warning: Invalid argument supplied for foreach() in
/usr/local/www/apache22/data/dialupadmin/lib/ldap/attrmap.php3 on line 5

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Rejected Calling Station id and radius reply message

2007-03-16 Thread Bishal

Hello

 I am using freeradius 1.1.3 in freebsd 6 with mysql database.
My problem is if I enable the calling-station-id in freeradius radcheck
table the rejected message is shown as below in radius log

Fri Mar 16 16:56:58 2007 : Info: rlm_sql (sql): No matching entry in the
database for request from user [test]
Fri Mar 16 16:56:58 2007 : Auth: Login incorrect (rlm_chap: Clear text
password not available): [test] (from client pppoe2 port 568 cli
0:7:95:10:73:9e)

The rejected message should be calling station id not allowed. Why I am
not getting the valid rejected reason. Same happens for Expired accounts
too. radius.log for Expiration accounts show:

Fri Mar 16 16:56:38 2007 : Auth: Login incorrect: [test2] (from client
pppoe2 port 566 cli 0:7:95:10:73:9e)

I have seetup radcheck table as follows:

++++--+--+
  | id | UserName   | Attribute  | Value| Op   |
  ++++--+--+
  |  1 | test  | User-Password   | wilma| == 
 |
  |  2 | test  | Expiration   | 10 Feb 2007  | :=
  |
  |  2 | test  | Calling-Station-Id   | 0:c0:26:8b:2a:e7   |
==   |
  ++++--+--+

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Question about rlm_sqlcounter

2006-12-27 Thread Bishal

Hi list,


 Is it possible to reset the monthly counter from the date of account
active/created to the end of the month (30days). Like: user abc renewed
his account 25hrs on 15 Dec 2006 and it will expire on 14th Jan 2007. Is
it possible to make counter reset on 15th Jan 2007?

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Reset sql counter

2006-12-24 Thread Bishal

Is it possible to reset the sql counter manually or by any scripts in
freeradius?

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Two sql queries in counter module

2006-11-02 Thread Bishal

Hello all

 Is it possible to make two queries in sql counter module? like


sqlcounter noresetcounter {
driver = "rlm_sqlcounter"
counter-name = Max-All-Session-Time
check-name = Max-All-Session
sqlmod-inst = sql
key = User-Name
reset = never
query1=SELECT activedate from radacct where
username='%{%k}"'
query = "SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='%{%k}' AND ActiveDate='$query1'"
}

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Sql counter

2006-10-14 Thread Bishal

Has anyone made a sql counter module for rechargeable account?

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


sqlcounter

2006-09-07 Thread bishal

Hello all


 How can I make sqlcounter module for rechargeable account in my
freeradius server with mysql backened.



Bsal

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


sqlcounter for rechargeable account

2006-09-05 Thread bishal

Hi all,


   Can anybody guide me how to make sql counter for rechargeable account.
like user "test01" subscribe for total of 25hours and after finishing
25hours if he wants to recharge his account again to 25hrs.


Bisal

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


freeradius stop automatically

2006-07-26 Thread bishal

After upgrading freeradius 1.0.5 to version 1.1.2 on Freebsd 6 my radius
server stop automatically with the following error essage.


Wed Jul 26 01:30:08 2006 : Error: Discarding duplicate request from
client pppoe-bhw:61882 - ID: 137 due to unfinished request 61

Wed Jul 26 01:30:08 2006 : Error: WARNING: Unresponsive child (id
135672320) for request 31

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Error while running log_badlogins scripts

2006-07-25 Thread bishal

Hello,


 I have installed Freeradius 1.1.2 in FreeBSD 6.0. Everything is running
well except log_badlogins script. When I run log_badlogins scripts it
gives me the error

ERROR: Date::Manip unable to determine TimeZone.
 at /usr/local/lib/perl5/site_perl/5.8.7/Date/Manip.pm line 3635
Date::Manip::Date_TimeZone called at
/usr/local/lib/perl5/site_perl/5.8.7/Date/Manip.pm line 676
Date::Manip::Date_Init() called at
/usr/local/lib/perl5/site_perl/5.8.7/Date/Manip.pm line 1446
Date::Manip::ParseDate('Tue Jul 25 16:15:44 2006') called at
./log_badlogins line 150

I have re-installed the perl modules Date::Manip.pm too but didn't work.
Looks like log_badlogins script is unable to parse the Unix date format.
Can anyone correct the script for freebsd use.


Thank you

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Freeradius + PPPOE tun interface

2006-03-30 Thread bishal

I am using PPPOE + Freeradius on Freebsd 6 for adsl connection. Whenever
there is power failure or somebody pull of the network cable at the
client end the user get disconnected from the internet connection.
and when I checked on pppoe server with ifconfig, I can see
the tun0 interface still hanging on and when the clients connect again
he get connected on the same tun0 interface with the same ip the user
can't browse the net. I tried by kill the tunnel interface but this
doesn't solve my problem.

 Is there any scrips or something that can automatically remove the stale
tunnel interface.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


radzap not working

2006-03-28 Thread bishal

Hello all,


   I have installed freeradius 1.0.5 in freebsd 6. I am authenticating
pppoe users to my remote freeradius server. I tried to delete the stale
session from radutmp file with radzap coammand but it doesnot work;

radwho shows the following login information:
#radwho
Login  Name  What  TTY  When  From  Location
test testaccount PPP   S11  Sun 14:58 192.168.0 192.168.0.100


#radzap -u test 192.168.0.5:S11 secret


PPPOE and freeradius are running in different freebsd server.

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Re: how to disconnect user after quota given to him finishes ?

2006-02-16 Thread bishal

You can use daily limit with Session Timeout.




On 2/16/2006, "Rupesh Amatya" <[EMAIL PROTECTED]> wrote:

>Dear all,
>The user gets logged out exactly after the time set in Session Time
>Out.
>
>But I am trying to create package like 4hours per day, 2 hours
>perday.
>If I put 4hours in Session time and after using 3 hours , if he
>disconnects and then reconnects, he can again use 4 hours.
>Is there a way that he can no more log in after he uses 4 hours/day ?
>
>
>Thanking you all,
>
>Rupesh Amatya
>
>
> Original Message 
>
>==> From: Lewis Bergman <[EMAIL PROTECTED]>
>==> Date: Wed, 15 Feb 2006 08:38:33 -0600
>
>Dear all,
>I am using Freeradius(with mysql as database for users ) with
>Mikrotik
>as NAS. This for PPPOE users. I used Dialup Admin to manage
>freeradius.
> There is default package of 4hours/day but the users do not get >
>disconnect after 4 hours. It just shows " Out of Quota". What needs >
>to be done to automatically disconnect user after the daily quota is
>>
>finished ?
>
>
>**
>
>
> There a few session attrbutes you could use for this.
>Session-Timeout
>is the first one that springs to mind. I don't know if the client
>will
>pay attention to it though.
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Mikrotik router Tx/Rx attribute and freeradius

2006-01-25 Thread bishal

Is it possible to limit the data transfer rate with freeradius and
mikrotik. If possbile then where should I specify what attribute. For
example I want to authenticate the users with freeradius + mysql and
mikrotik router and limit the Tx/Rx rate to 64Kbps/32Kbps.
 How can I do that?

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Password chaning and usage viewing interface for client

2006-01-25 Thread bishal

Hello all

Is their any web interface for clients, so that they can
change their password and view their account usage status.?

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: dialup-admin problem

2006-01-24 Thread bishal

Mine too is FreeBSD 6.0 with Apache2.2.0 and php5.1 Dialup admin works
fine only one dialup menu option i.e "Statistics" when I click on it,
gives the error as follows;


Warning: mktime() expects parameter 1 to be long, string given in
/usr/home/httpd/baayu.com/dialbaayu/lib/functions.php3 on line 83

Warning: mktime() expects parameter 1 to be long, string given in
/usr/home/httpd/baayu.com/dialbaayu/lib/functions.php3 on line 83
==


On 1/24/2006, "Scott Miller" <[EMAIL PROTECTED]> wrote:

>I've found that my problem might be with Apache 2 and PHP 5 - does anyone
>else have dialup-admin running properly on Apache 2 and PHP 5?  I'd hate to
>think I'd have to downgrade.
>
>Thanks,
>Scott
>
>
>- Original Message -
>From: "Scott Miller" <[EMAIL PROTECTED]>
>To: "FreeRadius users mailing list" 
>Sent: Monday, January 23, 2006 1:03 PM
>Subject: dialup-admin problem
>
>
>> I've installed freeradius 1.1.0, went through all the tests and everything
>> (the tests) seems to be working fine there.  My platform is:
>>
>> Fedora Core 4
>> Sendmail 8.13.4
>> Apache 2.0.54
>> MySQL 4.1.16
>> PHP 5.0.5-2.1
>> Freeradius 1.1.0
>>
>> I've also followed the instructions for the dialup-admin, and have run
>> into a problem.  When I view servername.com/dialup-admin, I can see the
>> first page just fine, but when I click on any link on the left, the right
>> side just turns white - nothing displays.  The "home" link brings me back
>> to the "A web based administration interface for the freeradius radius
>> server " page, but no other links seem to bring anyting up.
>>
>> Here's what I did:
>>
>> 1.  Copied the directory dialup-admin to the /user/local/ directory
>> 2.  In /var/www/html I created a simlink /user/local/dialup-admin/htdocs
>> named dialup-admin
>> ln -s /usr/local/dialup-admin/htdocs /var/www/html/dialup-admin
>> 3.  Edited httpd.conf to the following
>>
>># Scott Added for freeradius dialup-admin
>>#LoadModule php4_module libexec/libphp4.so
>>#AddModule mod_php4.c
>>AddType application/x-httpd-php .php
>>AddType application/x-httpd-php .php3
>>
>> I had to comment out the fist two lines, because httpd kept failing and
>> producing the error: Apache 1.3 configuration directives found please read
>> /usr/share/doc/httpd-2.0.54/migration.html
>>
>> 4.  I did not do: [1.3.2.2] Creating a more secure web interface. -
>> wanting to make it work first, then will start securing it.
>> 5.  Created the 4 additional MySQL Databases according to the instructions
>> and all look fine.
>> 6.  I then went through the general configuraiton options.  I commented
>> out all LDAP options, and fixed the following:
>>
>> 
>> general_prefered_lang: en
>> general_prefered_lang_name: English
>> general_charset: iso-8859-1
>> #general_decode_normal_attributes: yes
>> general_base_dir: /usr/local/dialup-admin
>> general_radiusd_base_dir: /usr/local/radiusd
>> general_use_session: no
>> general_most_recent_fl: 30
>> #general_strip_realms : yes
>> general_realm_delimiter: @
>> general_realm_format: suffix
>> general_show_user_password: yes
>> general_raddb_dir: %{general_radiusd_base_dir}/etc/raddb
>> general_ldap_attrmap: %{general_raddb_dir}/ldap.attrmap
>> #general_clients_conf: %{general_raddb_dir}/clients.conf
>> general_clients_conf: /usr/local/etc/raddb/clients.conf
>> general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap
>> general_accounting_attrs_file: %{general_base_dir}/conf/accounting.attrs
>> general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap
>> general_lib_type: sql
>> general_user_edit_attrs_file: %{general_base_dir}/conf/user_edit.attrs
>> general_sql_attrs_file: %{general_base_dir}/conf/sql.attrs
>> general_default_file: %{general_base_dir}/conf/default.vals
>> #general_ld_library_path: /usr/local/snmpd/lib
>> general_finger_type: snmp
>> general_nas_type: cisco
>> general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger
>> general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient
>> general_test_account_login: test
>> general_test_account_password: testpass
>> general_radius_server: localhost
>> general_radius_server_port: 1812
>> general_radius_server_auth_proto: pap
>> general_radius_server_secret: commented-out
>> general_auth_request_file: %{general_base_dir}/conf/auth.request
>> general_encryption_method: crypt
>> general_accounting_info_order: desc
>> general_stats_use_totacct: no
>> general_restrict_badusers_access: no
>> INCLUDE: %{general_base_dir}/conf/naslist.conf
>> INCLUDE: %{general_base_dir}/conf/captions.conf
>> #ldap_server: ldap.%{general_domain}
>> #ldap_write_server: master.%{general_domain}
>> #ldap_base: dc=company,dc=com
>> #ldap_binddn: cn=Directory Manager
>> #ldap_bindpw: XXX
>> #ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base}
>> #ldap_default_dn: uid=default-dialup,%{ldap_base}
>> 

Re: Freeradius 1.1.0 crash on FreeBSD 6

2006-01-22 Thread bishal

Ok I followed the step in bug #98 and compiled with "./configure
--disable-shared" Now when I tried to run the radiusd -X " it shows "

/libexec/ld-elf.so.1: Shared object "libperl.so" not found, required by
"radiusd"

while searching the "libperl.so" it was located in
"/usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so " so I linked it with
command "# ln -s /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
/libexec/ld-elf.so.1" but it still shows same error ?




On 1/22/2006, "Nicolas Baradakis" <[EMAIL PROTECTED]> wrote:

>[EMAIL PROTECTED] wrote:
>
>> #0  0x280ba250 in lt_dlsym (handle=0x811a800, symbol=0xbfbfd8f0
>> "rlm_counter") at ltdl.c:3330
>> 3330  lensym = LT_STRLEN (symbol) + LT_STRLEN
>> (handle->loader->sym_prefix)
>> [New LWP 100191]
>> (gdb) bt
>> #0  0x280ba250 in lt_dlsym (handle=0x811a800, symbol=0xbfbfd8f0
>> "rlm_counter") at ltdl.c:3330
>> #1  0x080544e7 in find_module_instance ()
>> #2  0x08054a64 in setup_modules ()
>> #3  0x0804c79e in main ()
>
>It's bug #98.
>http://bugs.freeradius.org/show_bug.cgi?id=98
>
>--
>Nicolas Baradakis
>
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Freeradius 1.1.0 crash on FreeBSD 6

2006-01-22 Thread bishal

Dear all,


   I have installed Freeradius 1.1.0 in FreeBSD with Mysql
5.0.17. Authenticaiton an authorization works fine. But when I enable
the "Max-Daily-Session" module it crashes with segmentation fault. and
"radiusd.core" file is created. Below is the dumped file of
radiusd.core file:
==
bw-proj# gdb /usr/local/sbin/radiusd radiusd.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging
symbols found)...
Core was generated by `radiusd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.3...(no debugging symbols
found)...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /usr/local/lib/libradius-1.1.0.so...done.
Loaded symbols for /usr/local/lib/libradius-1.1.0.so
Reading symbols from /usr/local/lib/libltdl.so.4...done.
Loaded symbols for /usr/local/lib/libltdl.so.4
Reading symbols from /usr/lib/libssl.so.4...done.
Loaded symbols for /usr/lib/libssl.so.4
Reading symbols from /lib/libcrypto.so.4...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /usr/lib/libpthread.so.2...done.
Loaded symbols for /usr/lib/libpthread.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/rlm_exec-1.1.0.so...done.
Loaded symbols for /usr/local/lib/rlm_exec-1.1.0.so
Reading symbols from /usr/local/lib/rlm_expr-1.1.0.so...done.
Loaded symbols for /usr/local/lib/rlm_expr-1.1.0.so
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x280ba250 in lt_dlsym (handle=0x811a800, symbol=0xbfbfd8f0
"rlm_counter") at ltdl.c:3330
3330  lensym = LT_STRLEN (symbol) + LT_STRLEN
(handle->loader->sym_prefix)
[New LWP 100191]
(gdb) bt
#0  0x280ba250 in lt_dlsym (handle=0x811a800, symbol=0xbfbfd8f0
"rlm_counter") at ltdl.c:3330
#1  0x080544e7 in find_module_instance ()
#2  0x08054a64 in setup_modules ()
#3  0x0804c79e in main ()
=

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Error with dialup admin

2006-01-20 Thread bishal

Hello all

 I have installed freeradius 1.1.0 in freebsd 6.0. While clicking on
statistic menu of dialup page I got this error.

Warning: mktime() expects parameter 1 to be long, string given in
/usr/home/httpd/baayu.com.np/baayucom/dialbaayu/lib/functions.php3 on
line 83

Warning: mktime() expects parameter 1 to be long, string given in
/usr/home/httpd/baayu.com.np/baayucom/dialbaayu/lib/functions.php3 on
line 83

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html