(RADIATOR) Re: Conditional IP Pool Allocation

Nayeem nayeem at gulfnetksa.com
Mon May 5 06:07:58 CDT 2003


Dear Hugh,

After modification our configuration file, we got error "Invalid Reply Item
PoolHint Ignored" , below is my configuration file text

###### Configuration File

<Client 212.24.75.20>
 Identifier NAS0
 Secret mysecret
 DupInterval 0
</Client>

<AddressAllocator SQL>

 Identifier AllocateFromSQL

 DBSource dbi:ODBC:mydsn
 DBUsername username
 DBAuth  password

 AddAddressQuery insert into RADPOOL (STATE, TIME_STAMP, POOL, \
   YIADDR, SUBNETMASK, DNSSERVER, USERNAME, NAS ) values (0, %t, '%0', '%1',
\
   '%2', '%3', '%n', '%{Calling-Station-Id}')

 <AddressPool NAS0.zajilemail.net>
  Subnetmask 255.255.255.0
  DNSServer  212.24.74.5
  Range  212.26.222.3 212.26.222.99
 </AddressPool>

</AddressAllocator>

<AddressAllocator SQL>


 Identifier AllocateFromSQL1

 DBSource dbi:ODBC:mydsn
 DBUsername username
 DBAuth  pasword

 AddAddressQuery insert into RADPOOL (STATE, TIME_STAMP, POOL, \
   YIADDR, SUBNETMASK, DNSSERVER, USERNAME, NAS) values (0, %t, '%0', '%1',
\
   '%2', '%3', '%n', '%{Calling-Station-Id}')

 <AddressPool NAS0.domainname.net>
  Subnetmask 255.255.255.0
  DNSServer  212.24.74.5
  Range  212.26.253.54 212.26.253.244
 </AddressPool>
</AddressAllocator>


<AddressAllocator SQL>


 Identifier AllocateFromSQL2

 DBSource dbi:ODBC:mydsn
 DBUsername username
 DBAuth  password

 AddAddressQuery insert into RADPOOL (STATE, TIME_STAMP, POOL, \
   YIADDR, SUBNETMASK, DNSSERVER, USERNAME, NAS) values (0, %t, '%0', '%1',
\
   '%2', '%3', '%n', '%{Calling-Station-Id}')

 <AddressPool NAS0.domainname.net>
  Subnetmask 255.255.255.0
  DNSServer  212.24.74.5
  Range  212.26.253.128 212.26.253.191
 </AddressPool>
</AddressAllocator>




<AuthBy FILE>
 Identifier Check_in_FILE
 NoDefaultIfFound
 Filename %D/in_users1

</AuthBy>

<AuthBy SQL>
 NoDefault
 Identifier Check_SQL

 DBSource dbi:ODBC:mydsn
 DBUsername username
 DBAuth  password


 AuthSelect  select password,plantype from subscriber \
  where username = substring('%n', 1, patindex('%@%', '%n') -1)


 AuthColumnDef 0, User-Password, check
 AuthColumnDef 1, PoolHint, reply

 AccountingStopsOnly

 AcctSQLStatement exec Usage '%n','%{NAS-Port}', %{Acct-Input-Octets},\
  %{Acct-Output-Octets},'%{Acct-Session-Id}', %{Acct-Session-Time}, \
  '%m/%d/%Y %H:%M:%S'

 AddToReplyIfNotExist PoolHint = AllocateIPAddress

 AddToReply Service-Type = Framed-User, \
 Framed-Protocol = PPP, \
 Framed-Compression = Van-Jacobson-TCP-IP

</AuthBy>



<AuthBy DYNADDRESS>
 Identifier AllocateIPAddress
 Allocator AllocateFromSQL
 PoolHint %{Client:Identifier}.%R
</AuthBy>

# dsl1 and dsl2 is plantype mention in Database.

<AuthBy DYNADDRESS>
 Identifier dsl1
 Allocator AllocateFromSQL1
 PoolHint %{Reply:PoolHint}.%R
</AuthBy>

<AuthBy DYNADDRESS>
 Identifier dsl2
 Allocator AllocateFromSQL2
 PoolHint %{Reply:PoolHint}.%R
</AuthBy>


<Handler  Request-Type = Accounting-Request>

 RewriteUsername s/\s+//g
 RewriteUsername   tr/A-Z/a-z/
 RewriteUsername      s/^([^@]+).*/$1/
 RewriteUsername s/(.*)/$1\@domainname.net/

 AuthByPolicy ContinueAlways
 AuthBy Check_SQL
 AuthBy Check_SQL1
 AcctLogFileName %L/email/detail
 SessionDatabase SDB1

</Handler>

<Handler>
 MaxSessions 1

 RewriteUsername s/\s+//g
 RewriteUsername   tr/A-Z/a-z/
 RewriteUsername      s/^([^@]+).*/$1/
 RewriteUsername s/(.*)/$1\@domainname.net/

 <AuthLog SQL>

 DBSource dbi:ODBC:mydsn
 DBUsername username
 DBAuth  password

 Table Logcalls
 SuccessQuery Insert into Logcalls (username, priority, Message,
Phonenumber, Password, NAS) \
   values ('%n', %0, %1, '%{Calling-Station-Id}', '%P', '%N')

 FailureQuery  Insert into Logcalls (username, priority, Message,
Phonenumber, Password, NAS) \
   values ('%n', %0, %1, '%{Calling-Station-Id}', '%P', '%N')

  LogSuccess 1
  LogFailure 1

 </AuthLog>

 AuthByPolicy ContinueWhileAccept
 <AuthBy GROUP>
  AuthByPolicy ContinueUntilAccept
  AuthBy Check_in_FILE

 </AuthBy>

 SessionDatabase SDB1
</Handler>


#### End here.


Regards,
Nayeem.











----- Original Message -----
From: "Hugh Irvine" <hugh at open.com.au>
To: "Mohammed AbdusSami" <abdussami at gulfnetksa.com>
Cc: "'Radiator (Radiator)'" <radiator at open.com.au>
Sent: Monday, May 05, 2003 2:53 AM
Subject: (RADIATOR) Re: Conditional IP Pool Allocation


>
> Hello AdbusSami -
>
> You should set up your address pools with the plantype values and use
> them directly in the PoolHint:
>
> <AddressPool p1>
> ....
> </AddressPool>
> <AddressPool p2>
> ....
> </AddressPool>
> <AddressPool p3>
> .....
> </AddressPool>
>
> Then your AuthSelect would look like this:
>
> AuthSelect select PASSWORD, PLANTYPE, ....
> AuthColumnDef 0, Password, check
> AuthColumnDef 1, PoolHint, reply
> .....
> AddToReplyIfNotExist PoolHint = p3
>
> And your AuthBy DYNADDRESS would look like this:
>
> .....
> PoolHint %{Reply:PoolHint}
> .....
>
> See the corresponding sections in the Radiator 3.6 reference manual
> ("doc/ref.html").
>
> regards
>
> Hugh
>
>
> On Sunday, May 4, 2003, at 17:15 Australia/Melbourne, Mohammed
> AbdusSami wrote:
>
> > Dear All,
> >
> > How can I do following :
> >
> > Allocation of IP pool depend on plan type. For example I have 2 DSL
> > customers of plan type p1 & p2 respectively. when they request to
> > connect
> > they should get ip pool pool1  & pool2 respectively.  And the plan type
> > value I want to retrieve from "AuthSelect"
> >
> >
> > If plantype = p1
> > Pool1
> > If plantype = p2
> > Pool2
> > Else
> > Pool3
> >
> >
> >
> >
> > Thanks in Advance.
> >
> > Regards,
> >
> > AbdusSami
> >
> >
> >
> >
>
> NB: have you included a copy of your configuration file (no secrets),
> together with a trace 4 debug showing what is happening?
>
> --
> 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.
>
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>


===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list