Title: <AddressAllocatorSQL>

Hello,

Is there any way to disable ReclaimQuery during radiator startup.
Using <AddressAllocatorSQL> on one radius server with one database should be fine.
But not in <AuthBy ROUNDROBIN> environment. Here is our machine configuration.

1. One Ericsson GSN with 2 radius clients. It send access request, a/c start, a/c stop to radius proxy using <AuthBy ROUNDROBIN>.

2. The proxy will forward those request to two radius server for enhancing performance.
3. The two radius server use <AddressAllocatorSQL> to reply ip address to client. They share a RADPOOL reside in mysql db.

Serious problem arises when either one radius server restart, it will reset all ip address STATE to zero. Pls see debug message.

Even though some ip address is already allocated by another health radius server.
Is anyone have different implementation method.
Can anyone give me some hint.
Pls find attached radius.cfg for your reference.


Harrison
SmarTone BroadBand Services Limited



Wed Aug 22 19:22:11 2001: DEBUG: Reading users file /usr/local/etc/raddb/users.accept
Wed Aug 22 19:22:11 2001: DEBUG: Reading users file /usr/local/etc/raddb/users.reject
Wed Aug 22 19:22:11 2001: DEBUG: Checking address 202.140.74.2
Wed Aug 22 19:22:11 2001: DEBUG: Query is: select STATE from RADPOOL where YIADDR='202.140.74.2'
...
...

Wed Aug 22 19:22:14 2001: DEBUG: Reclaiming expired leases
Wed Aug 22 19:22:14 2001: DEBUG: do query is: update RADPOOL set STATE=0 where state!=0 and EXPIRY < 998479334

Wed Aug 22 19:22:14 2001: INFO: Server started: Radiator 2.18.2 on grad1
Wed Aug 22 19:22:14 2001: DEBUG: Packet dump:
*** Received from 10.25.157.17 port 1033 ....
Code:       Access-Request
...
...



<<radius.proxy.txt>>

<<radius.server.txt>>

###### Global Parameters ##################

Trace 4 

AuthPort        1812

AcctPort        1813

LogDir /var/log/radius

DbDir /usr/local/etc/raddb

LogFile %L/grad3.logfile.%Y%m%d

DictionaryFile %D/dictionary

PidFile %L/radiusd.pid

###########################################




###### NAS Client #########################

<Client 202.140.74.1>
        Secret xxx
</Client>

<Client 10.25.155.1>
        Secret xxx
</Client>

<Client localhost>
        Secret mysecret
        DupInterval 0
</Client>

###########################################




###### Log SQL ############################

<Log SQL>

        Identifier logsql

        DBSource dbi:mysql:radius:10.25.157.33

        DBUsername xxx
        DBAuth xxx

        Table RADLOG
        Trace 3
        LogQuery insert into RADLOG (TIME_STAMP,PRIORITY,MESSAGE,HOST) values 
(%t,%0,%2,'%h')

</Log SQL>

###########################################




###### AuthBy Module ######################

<AuthBy FILE>
        Identifier defaultaccept
        Filename %D/users.accept
</AuthBy>



<AuthBy FILE>
        Identifier defaultreject
        Filename %D/users.reject
</AuthBy>




<AuthBy ROUNDROBIN>

        Identifier roundrobin

        <Host 10.25.157.19>
                Secret xxx
                AuthPort 1812
                AcctPort 1813
        </Host>

        <Host 10.25.157.18>
                Secret xxx
                AuthPort 1812
                AcctPort 1813
        </Host>

</AuthBy>

###########################################





###### Handler Module #####################

<Handler Client-Id = 202.140.74.1,NAS-Identifier = "radius">

        RejectHasReason

        RewriteUsername s/^([^@]+).*/$1/

        #SessionDatabase simultaneous

        AuthBy roundrobin

        AcctLogFileName %L/%c/grad3.%c.detail.%Y%m%d

        PasswordLogFileName %L/grad3.password.%Y%m%d

</Handler>




<Handler Client-Id = 10.25.155.1,NAS-Identifier = "rad">

        RejectHasReason

        RewriteUsername s/^([^@]+).*/$1/

        #SessionDatabase simultaneous

        AuthBy roundrobin

        AcctLogFileName %L/%c/grad3.%c.detail.%Y%m%d

        PasswordLogFileName %L/grad3.password.%Y%m%d

</Handler>




<Handler Client-Id = localhost>

        RejectHasReason

        RewriteUsername s/^([^@]+).*/$1/

        AuthBy defaultaccept

        AcctLogFileName %L/%c/grad3.%c.detail.%Y%m%d

        PasswordLogFileName %L/grad3.password.%Y%m%d

</Handler>

###########################################

###### Global Parameters ##################

Trace 4 

AuthPort        1812

AcctPort        1813

LogDir /var/log/radius

DbDir /usr/local/etc/raddb

LogFile %L/grad1.logfile.%Y%m%d

DictionaryFile %D/dictionary

PidFile %L/radiusd.pid

###########################################




###### NAS Client #########################

<Client 10.25.157.17>
        Secret xxx
</Client>

<Client localhost>
        Secret mysecret
        DupInterval 0
</Client>

###########################################




###### Log SQL ############################

<Log SQL>

        Identifier logsql

        DBSource dbi:mysql:radius:10.25.157.33

        DBUsername xxx
        DBAuth xxx

        Table RADLOG
        Trace 3
        LogQuery insert into RADLOG (TIME_STAMP,PRIORITY,MESSAGE,HOST) values 
(%t,%0,%2,'%h')

</Log SQL>

###########################################




###### Simultaneous-use Limit Checking ####

<SessionDatabase SQL>

        Identifier simultaneous 

        DBSource dbi:mysql:radius:10.25.157.33
        DBUsername xxx
        DBAuth xxx

        AddQuery insert into RADONLINE 
(USERNAME,CALLINGSTATIONID,NASIDENTIFIER,NASPORT,ACCTSESSIONID,\
                 TIME_STAMP,FRAMEDIPADDRESS) \
                 values 
('%u','%{Calling-Station-Id}','%N',%{NAS-Port},'%{Acct-Session-Id}',\
                 %{Timestamp},'%{Framed-IP-Address}')

        DeleteQuery delete from RADONLINE where NASIDENTIFIER='%N' and 
NASPORT=%{NAS-Port}

        CountQuery select NASIDENTIFIER,NASPORT from RADONLINE where USERNAME='%u'

        ClearNasQuery delete from RADONLINE where NASIDENTIFIER='%N'

</SessionDatabase SQL>

###########################################




###### AuthBy Module ######################

<AuthBy FILE>
        Identifier defaultaccept
        Filename %D/users.accept
</AuthBy>



<AuthBy FILE>
        Identifier defaultreject
        Filename %D/users.reject
</AuthBy>



<AuthBy SQL>

        Identifier getpoolhint
        DBSource dbi:mysql:radius:10.25.157.33
        DBUsername xxx
        DBAuth xxx

        AuthSelect select POOLHINT from APN where ROAMDIGIT = 
left("%{Calling-Station-Id}",3)
        AuthColumnDef 0, PoolHint, reply
 
        AccountingTable ACCOUNTING

        AcctColumnDef USERNAME,User-Name
        AcctColumnDef CLASS,Class
        AcctColumnDef ACCTSESSIONID,Acct-Session-Id
        AcctColumnDef NASIPADDRESS,NAS-IP-Address
        AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
        AcctColumnDef NASPORT,NAS-Port,integer
        AcctColumnDef ACCTAUTHENTIC,Acct-Authentic
        AcctColumnDef NASIDENTIFIER,NAS-Identifier
        AcctColumnDef FRAMEDPROTOCOL,Framed-Protocol
        AcctColumnDef CALLINGSTATIONID,Calling-Station-Id
        AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
        AcctColumnDef TIMESTAMP,Timestamp,integer

        AcctFailedLogFileName %L/grad1.%c.missing.%Y%m%d

</AuthBy SQL>

###########################################




###### Allocator Module #####################

<AddressAllocator SQL>

        Identifier myallocator

        DBSource dbi:mysql:radius:10.25.157.33
        DBUsername xxx
        DBAuth xxx

        AllocateQuery update RADPOOL set 
STATE=1,TIME_STAMP=%0,EXPIRY=%1,USERNAME='%2',CALLINGSTATIONID='%{Calling-Station-Id}' 
\
                      where YIADDR='%3' and TIME_STAMP%4 

        <AddressPool local>
                Subnetmask 255.255.255.0
                Range 202.140.74.2 202.140.74.254
        </AddressPool>

        <AddressPool roam>
                Subnetmask 255.255.255.0
                Range 10.25.155.2 10.25.155.254
                Range 10.25.181.2 10.25.181.254
        </AddressPool>

</AddressAllocator SQL>

###########################################




###### Handler Module #####################

<Handler Client-Id = 10.25.157.17>

        RejectHasReason

        SessionDatabase simultaneous

        AuthByPolicy ContinueWhileAccept

        AuthBy defaultaccept
        AuthBy getpoolhint

        <AuthBy DYNADDRESS>

                Allocator myallocator
                PoolHint %{Reply:PoolHint}
                MapAttribute yiaddr, Framed-IP-Address
                MapAttribute subnetmask, Framed-IP-Netmask
                StripFromReply PoolHint
                AddToReply Class = SI=Testing

        </AuthBy DYNADDRESS>

        AcctLogFileName %L/%c/grad1.%c.detail.%Y%m%d
        PasswordLogFileName %L/grad1.password.%Y%m%d

</Handler>




<Handler Client-Id = localhost>

        RejectHasReason

        RewriteUsername s/^([^@]+).*/$1/

        SessionDatabase simultaneous

        AuthByPolicy ContinueUntilIgnore

        AuthBy defaultaccept

        AcctLogFileName %L/%c/grad1.%c.detail.%Y%m%d

        PasswordLogFileName %L/grad1.password.%Y%m%d

</Handler>

###########################################

Reply via email to