<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>RE: Assign IP based on CallingStationID.</TITLE>
</HEAD>
<BODY>
<BR>
<BR>
<P><FONT SIZE=2>Here is the query that I put into sql.conf</FONT>
<BR><FONT SIZE=2>Maybe use it and build on it for your </FONT>
<BR><FONT SIZE=2>specific example ??</FONT>
</P>
<P><FONT SIZE=2>authorize_check_query = "select id,UserName,Attribute,Value,op FROM </FONT>
<BR><FONT SIZE=2>${authcheck_table} WHERE UserName in</FONT>
<BR><FONT SIZE=2>(select UserName from ${authcheck_table} WHERE Value = '%{Calling-Station-ID}')</FONT>
<BR><FONT SIZE=2>ORDER BY id"</FONT>
</P>
<P><FONT SIZE=2>John</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From:</FONT>
<BR><FONT SIZE=2>freeradius-users-bounces+jlongland=grintek.com@lists.freeradius.org</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:freeradius-users-bounces+jlongland=grintek.com@lists.freeradius">mailto:freeradius-users-bounces+jlongland=grintek.com@lists.freeradius</A>.</FONT>
<BR><FONT SIZE=2>org]On Behalf Of banga</FONT>
<BR><FONT SIZE=2>Sent: 08 November 2006 15:14</FONT>
<BR><FONT SIZE=2>To: freeradius-users@lists.freeradius.org</FONT>
<BR><FONT SIZE=2>Subject: Assign IP based on CallingStationID.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>I use dafault table-layout.</FONT>
<BR><FONT SIZE=2>How I understand you just change username authentication to callingstationid</FONT>
<BR><FONT SIZE=2>authentication inside sql.conf. Thx, it’s really good idea. I think that I</FONT>
<BR><FONT SIZE=2>could do the same by myself, but it will take a time. </FONT>
<BR><FONT SIZE=2>Therefore any examples will be very useful. Can you post it here?</FONT>
<BR><FONT SIZE=2>If It’s too big you can send it to me - “nebula-at-inbox-lv”.</FONT>
</P>
<P><FONT SIZE=2>>From other side, I need username/password authentication also (for other</FONT>
<BR><FONT SIZE=2>users) therefore it will be difficult to implement this ( may be I’ll</FONT>
<BR><FONT SIZE=2>install another freeradius specially for that).</FONT>
</P>
<P><FONT SIZE=2>In my situation radius for some users check username/password, for other</FONT>
<BR><FONT SIZE=2>users it should do the next:</FONT>
<BR><FONT SIZE=2>check username/password/callingstationid (in fact username and password</FONT>
<BR><FONT SIZE=2>always the same)</FONT>
<BR><FONT SIZE=2>if callingstationid has specific value (can be dosen specifc</FONT>
<BR><FONT SIZE=2>callingstationid_s) then replay accept and some specific IP for each</FONT>
<BR><FONT SIZE=2>specific callingstationid or just assign ip from radius pool. </FONT>
<BR><FONT SIZE=2>if callingstationid is not in the list of “specific callingstationid” then</FONT>
<BR><FONT SIZE=2>just replay accept and NAS will assign ip from equipment’s IP pool</FONT>
</P>
<P><FONT SIZE=2>Main Idea: For now most users has the same username and password and it is</FONT>
<BR><FONT SIZE=2>not possible to change anything in that. Some callingstationid is not</FONT>
<BR><FONT SIZE=2>friendly for my network (they should have only http traffic). That’s why I</FONT>
<BR><FONT SIZE=2>want to assign them IP from specific pool – I going to setup firewall rules</FONT>
<BR><FONT SIZE=2>for a such IPs.</FONT>
</P>
<P><FONT SIZE=2>Any idea ?</FONT>
</P>
<BR>
<P><FONT SIZE=2>John Longland wrote:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Yes, I have just done it.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> You need to change the sql-statement in /etc/raddb/sql.conf</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> That is the </FONT>
<BR><FONT SIZE=2>> autorize_check_query.Depending on how you use your tables, the query</FONT>
<BR><FONT SIZE=2>> that I am using may or may not work. If you want I can give you the</FONT>
<BR><FONT SIZE=2>> one that works for me if you supply your table-layout.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> JOhn</FONT>
<BR><FONT SIZE=2>> P.S> The statement I use does NOT check username/password !!!</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From:</FONT>
<BR><FONT SIZE=2>> freeradius-users-bounces+jlongland=grintek.com@lists.freeradius.org</FONT>
<BR><FONT SIZE=2>> [<A HREF="mailto:freeradius-users-bounces+jlongland=grintek.com@lists.freeradius">mailto:freeradius-users-bounces+jlongland=grintek.com@lists.freeradius</A>.</FONT>
<BR><FONT SIZE=2>> org]On Behalf Of banga</FONT>
<BR><FONT SIZE=2>> Sent: 08 November 2006 11:37</FONT>
<BR><FONT SIZE=2>> To: freeradius-users@lists.freeradius.org</FONT>
<BR><FONT SIZE=2>> Subject: Assign IP based on CallingStationID.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Hello all.</FONT>
<BR><FONT SIZE=2>> I use freeradius ver. 1.1.1 + mysql.</FONT>
<BR><FONT SIZE=2>> I use same login/password for couple of users but they has different</FONT>
<BR><FONT SIZE=2>> callingstationid. </FONT>
<BR><FONT SIZE=2>> Is it possible to check callingstationid and asiighn IP based on it? </FONT>
<BR><FONT SIZE=2>> Do I need to create some additional tables in mysql for that?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Thx.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -- </FONT>
<BR><FONT SIZE=2>> View this message in context:</FONT>
<BR><FONT SIZE=2>> <A HREF="http://www.nabble.com/Assign-IP-based-on-CallingStationID.-tf2594146.html#a7" TARGET="_blank">http://www.nabble.com/Assign-IP-based-on-CallingStationID.-tf2594146.html#a7</A></FONT>
<BR><FONT SIZE=2>> 235317</FONT>
<BR><FONT SIZE=2>> Sent from the FreeRadius - User mailing list archive at Nabble.com.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> - </FONT>
<BR><FONT SIZE=2>> List info/subscribe/unsubscribe? See</FONT>
<BR><FONT SIZE=2>> <A HREF="http://www.freeradius.org/list/users.html" TARGET="_blank">http://www.freeradius.org/list/users.html</A></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> - </FONT>
<BR><FONT SIZE=2>> List info/subscribe/unsubscribe? See</FONT>
<BR><FONT SIZE=2>> <A HREF="http://www.freeradius.org/list/users.html" TARGET="_blank">http://www.freeradius.org/list/users.html</A></FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>View this message in context: <A HREF="http://www.nabble.com/Assign-IP-based-on-CallingStationID.-tf2594146.html#a7238235" TARGET="_blank">http://www.nabble.com/Assign-IP-based-on-CallingStationID.-tf2594146.html#a7238235</A></FONT>
<BR><FONT SIZE=2>Sent from the FreeRadius - User mailing list archive at Nabble.com.</FONT>
</P>
<BR>
<P><FONT SIZE=2>- </FONT>
<BR><FONT SIZE=2>List info/subscribe/unsubscribe? See <A HREF="http://www.freeradius.org/list/users.html" TARGET="_blank">http://www.freeradius.org/list/users.html</A></FONT>
</P>
</BODY>
</HTML>