(RADIATOR) AllocateQuery

Hugh Irvine hugh at open.com.au
Tue Aug 21 02:16:19 CDT 2001


Hello Harrison -

Further to my previous mail, here is a patched version of 
AddressAllocatorSQL.pm for you to test.

Please let me know if it works correctly and I will roll the fix into the 
next release.

regards

Hugh


On Tuesday 21 August 2001 12:59, Harrison Ng wrote:

> > Hello,
>
> Does anyone know is it valid to include %{attribute-name} in AllocateQuery
> of <AddressAllocator SQL>.
> We've append a new column called MSISDN in RADPOOL to record
> Calling-Station-Id. Then add custom AllocateQuery as below.
> Under trace 4, it seems that radiator return empty value for
> %{Calling-Station-Id}.
> However we tried similar things in AuthSelect of <AuthBy SQL>,
> %{Calling-Station-Id} works properly.
> Can anyone give me a hint.
>
> Harrison
> SmarTone Mobile Communications Ltd.
>
>
>
>
>
>
> This is an extract of radius.cfg
> --------------------------------------------
>
> <AuthBy SQL>
>
>         Identifier getpoolhint
>         DBSource dbi:mysql:radius:10.25.157.33
>         DBUsername dbuser1
>         DBAuth netra323
>
>         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>
>
>
>
> <AddressAllocator SQL>
>
>         Identifier myallocator
>
>         DBSource dbi:mysql:radius:10.25.157.33
>         DBUsername dbuser1
>         DBAuth netra323
>
>         AllocateQuery update RADPOOL set
> STATE=1,TIME_STAMP=%0,EXPIRY=%1,USERNAME='%2',MSISDN='%{Calling-Station-Id}
>' \
>                       where YIADDR='%3' and TIME_STAMP%4
>
>         <AddressPool local>
>                 Subnetmask 255.255.255.0
>                 Range 202.140.74.11 202.140.74.20
>         </AddressPool>
>
>         <AddressPool roam>
>                 Subnetmask 255.255.255.0
>                 Range 10.25.155.11 10.25.155.20
>         </AddressPool>
>
> </AddressAllocator SQL>
>
>
>
> This is radiator trace 4
> --------------------------------
>
> Tue Aug 21 10:48:09 2001: DEBUG: Packet dump:
> *** Received from 202.140.74.1 port 2859 ....
> Code:       Access-Request
> Identifier: 199
> Authentic:  <0><0>'_<0><0><7><249><0><0>bm<0><0><7>T
> Attributes:
>         User-Name = "aaaa"
>         User-Password =
> "A<228><31><204><205>(<27><166>-v<150>Z<220><180><207>U"
>         NAS-IP-Address = 202.140.74.1
>         Service-Type = Framed-User
>         Framed-Protocol = PPP
>         NAS-Port = 1
>         Calling-Station-Id = "85298699517"
>         NAS-Identifier = "radius"
>
> Tue Aug 21 10:48:09 2001: DEBUG: Check if Handler Client-Id =
> 202.140.74.1,NAS-Identifier = "radius" should be used to handle this
> request Tue Aug 21 10:48:09 2001: DEBUG: Handling request with Handler
> 'Client-Id = 202.140.74.1,NAS-Identifier = "radius"'
> Tue Aug 21 10:48:09 2001: DEBUG: simultaneous Deleting session for aaaa,
> 202.140.74.1, 1
> Tue Aug 21 10:48:09 2001: DEBUG: do query is: delete from RADONLINE where
> NASIDENTIFIER='202.140.74.1' and NASPORT=1
>
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthFILE
> Tue Aug 21 10:48:09 2001: DEBUG: Radius::AuthFILE looks for match with aaaa
> Tue Aug 21 10:48:09 2001: DEBUG: Radius::AuthFILE looks for match with
> DEFAULT
> Tue Aug 21 10:48:09 2001: DEBUG: Radius::AuthFILE ACCEPT: Accept explicitly
> by Auth-Type=Accept
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthSQL
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthSQL
> Tue Aug 21 10:48:09 2001: DEBUG: Query is: select POOLHINT from APN where
> ROAMDIGIT = left("85298699517",3)
>
> Tue Aug 21 10:48:09 2001: DEBUG: Radius::AuthSQL looks for match with aaaa
> Tue Aug 21 10:48:09 2001: DEBUG: Radius::AuthSQL ACCEPT:
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthDYNADDRESS
> Tue Aug 21 10:48:09 2001: DEBUG: Query is: select TIME_STAMP, YIADDR,
> SUBNETMASK, DNSSERVER from RADPOOL
> where POOL='local' and STATE=0 order by TIME_STAMP
>
> Tue Aug 21 10:48:09 2001: DEBUG: do query is: update RADPOOL set
> STATE=1,TIME_STAMP=998362089,EXPIRY=998448489,USERNAME='aaaa',MSISDN=''
> where YIADDR='202.140.74.11' and TIME_STAMP=998362069
>
> Tue Aug 21 10:48:09 2001: DEBUG: Access accepted for aaaa
> Tue Aug 21 10:48:09 2001: DEBUG: Packet dump:
> *** Sending to 202.140.74.1 port 2859 ....
> Code:       Access-Accept
> Identifier: 199
> Authentic:  <0><0>'_<0><0><7><249><0><0>bm<0><0><7>T
> Attributes:
>         Framed-IP-Netmask = 255.255.255.0
>         Framed-IP-Address = 202.140.74.11
>         Class = "SI=Testing"
>
> Tue Aug 21 10:48:09 2001: DEBUG: Packet dump:
> *** Received from 202.140.74.1 port 2860 ....
> Code:       Accounting-Request
> Identifier: 200
> Authentic:  <181><135>T<224><207>t<172>mc<239>$<206>c*W<182>
> Attributes:
>         User-Name = "aaaa"
>         Class = "SI=Testing"
>         Acct-Session-Id = ""000000Testing""
>         NAS-IP-Address = 202.140.74.1
>         Acct-Status-Type = Start
>         NAS-Port = 1
>         Acct-Authentic = RADIUS
>         NAS-Identifier = "radius"
>         Framed-Protocol = PPP
>         Calling-Station-Id = "85298699517"
>         Framed-IP-Address = 202.140.74.11
>
> Tue Aug 21 10:48:09 2001: DEBUG: Check if Handler Client-Id =
> 202.140.74.1,NAS-Identifier = "radius" should be used to handle this
> request Tue Aug 21 10:48:09 2001: DEBUG: Handling request with Handler
> 'Client-Id = 202.140.74.1,NAS-Identifier = "radius"'
> Tue Aug 21 10:48:09 2001: DEBUG: simultaneous Adding session for aaaa,
> 202.140.74.1, 1
> Tue Aug 21 10:48:09 2001: DEBUG: do query is: delete from RADONLINE where
> NASIDENTIFIER='202.140.74.1' and NASPORT=1
>
> Tue Aug 21 10:48:09 2001: DEBUG: do query is: insert into RADONLINE
> (USERNAME,NASIDENTIFIER,NASPORT,ACCTSESSIONID,TIME_STAMP,FRAMEDIPADDRESS,NA
>S PORTTYPE,SERVICETYPE) values
> ('aaaa','202.140.74.1',1,'"000000Testing"',998362089,'202.140.74.11','','')
>
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthFILE
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthSQL
> Tue Aug 21 10:48:09 2001: DEBUG: Handling accounting with Radius::AuthSQL
> Tue Aug 21 10:48:09 2001: DEBUG: do query is: insert into ACCOUNTING
>                 (USERNAME, CLASS, ACCTSESSIONID, NASIPADDRESS,
> ACCTSTATUSTYPE, NASPORT, ACCTAUTHENTIC, NASIDENTIFIER, FRAMEDPROTOCOL,
> CALLINGSTATIONID, FRAMEDIPADDRESS, TIMESTAMP)
>                 values
>                 ('aaaa', 'SI=Testing', '"000000Testing"', '202.140.74.1',
> 'Start', 1, 'RADIUS', 'radius', 'PPP', '85298699517', '202.140.74.11',
> 998362089)
>
> Tue Aug 21 10:48:09 2001: DEBUG: Handling with Radius::AuthDYNADDRESS
> Tue Aug 21 10:48:09 2001: DEBUG: Accounting accepted
> Tue Aug 21 10:48:09 2001: DEBUG: Packet dump:
> *** Sending to 202.140.74.1 port 2860 ....
> Code:       Accounting-Response
> Identifier: 200
> Authentic:  <181><135>T<224><207>t<172>mc<239>$<206>c*W<182>
> Attributes:
>
> Tue Aug 21 10:49:54 2001: DEBUG: Packet dump:
> *** Received from 202.140.74.1 port 2863 ....
> Code:       Accounting-Request
> Identifier: 201
> Authentic:  <157><156>W<220>8k<9><26>H<181><203>a<133><229><130><24>
> Attributes:
>         User-Name = "aaaa"
>         Class = "SI=Testing"
>         Acct-Session-Id = ""000000Testing""
>         NAS-IP-Address = 202.140.74.1
>         Acct-Status-Type = Stop
>         NAS-Port = 1
>         Acct-Authentic = RADIUS
>         NAS-Identifier = "radius"
>         Framed-Protocol = PPP
>         Calling-Station-Id = "85298699517"
>         Framed-IP-Address = 202.140.74.11
>
> Tue Aug 21 10:49:54 2001: DEBUG: Check if Handler Client-Id =
> 202.140.74.1,NAS-Identifier = "radius" should be used to handle this
> request Tue Aug 21 10:49:54 2001: DEBUG: Handling request with Handler
> 'Client-Id = 202.140.74.1,NAS-Identifier = "radius"'
> Tue Aug 21 10:49:54 2001: DEBUG: simultaneous Deleting session for aaaa,
> 202.140.74.1, 1
> Tue Aug 21 10:49:54 2001: DEBUG: do query is: delete from RADONLINE where
> NASIDENTIFIER='202.140.74.1' and NASPORT=1
>
> Tue Aug 21 10:49:54 2001: DEBUG: Handling with Radius::AuthFILE
> Tue Aug 21 10:49:54 2001: DEBUG: Handling with Radius::AuthSQL
> Tue Aug 21 10:49:54 2001: DEBUG: Handling accounting with Radius::AuthSQL
> Tue Aug 21 10:49:54 2001: DEBUG: do query is: insert into ACCOUNTING
>                 (USERNAME, CLASS, ACCTSESSIONID, NASIPADDRESS,
> ACCTSTATUSTYPE, NASPORT, ACCTAUTHENTIC, NASIDENTIFIER, FRAMEDPROTOCOL,
> CALLINGSTATIONID, FRAMEDIPADDRESS, TIMESTAMP)
>                 values
>                 ('aaaa', 'SI=Testing', '"000000Testing"', '202.140.74.1',
> 'Stop', 1, 'RADIUS', 'radius', 'PPP', '85298699517', '202.140.74.11',
> 998362194)
>
> Tue Aug 21 10:49:54 2001: DEBUG: Handling with Radius::AuthDYNADDRESS
> Tue Aug 21 10:49:54 2001: DEBUG: do query is: update RADPOOL set STATE=0,
> TIME_STAMP=998362194 where YIADDR='202.140.74.11'
>
> Tue Aug 21 10:49:54 2001: DEBUG: Accounting accepted
> Tue Aug 21 10:49:54 2001: DEBUG: Packet dump:
> *** Sending to 202.140.74.1 port 2863 ....
> Code:       Accounting-Response
> Identifier: 201
> Authentic:  <157><156>W<220>8k<9><26>H<181><203>a<133><229><130><24>
> Attributes:

----------------------------------------
Content-Type: text/html; charset="iso-8859-1"; name="Attachment: 1"
Content-Transfer-Encoding: quoted-printable
Content-Description: 
----------------------------------------

-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AddressAllocatorSQL.pm
Type: text/english
Size: 11597 bytes
Desc: not available
URL: <http://www.open.com.au/pipermail/radiator/attachments/20010821/cda25549/attachment.bin>


More information about the radiator mailing list