<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 13, 2014 at 12:30 PM, * <span dir="ltr"><<a href="mailto:zhex900@gmail.com" target="_blank">zhex900@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Thank you for your patience. I am very happy someone can help me. Now I made some progress.</div>
<div><br></div><div>I find out what the problem is now. In the query you provided I need to put quotes around radacct. Like this:</div><div class="">
<div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px"> query = "SELECT IFNULL(TIME_TO_SEC(TIMEDIFF(</span><span style="font-family:'trebuchet ms',sans-serif;font-size:13px">NOW(), MIN(AcctStartTime))),0) FROM <b><font color="#3d85c6">`radacct`</font> </b>WHERE UserName='%{%k}' ORDER BY AcctStartTime LIMIT 1;"</span><br>

</div><div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px"><br></span></div></div></div></blockquote><div><span style="font-family:trebuchet ms,sans-serif">Okay, good, there was error in username veritable as well in your previous query (<span style="font-size:13px">'%{%k}' </span>). Anyways. </span>happy it worked !!<br>
 <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class=""><div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px"></span></div>
</div><div><font face="trebuchet ms, sans-serif">Now, have one more problem. </font></div><div><font face="trebuchet ms, sans-serif"><br>
</font></div><div><font face="trebuchet ms, sans-serif">My NAS (Mikrotik) is not receiving the Session-Timout. I cannot see it in the NAS log. I only can see </font>Acct-Session-Time. <span style="font-family:'trebuchet ms',sans-serif">Therefore it is not terminating the session. For testing I have set the time limit to 60 seconds. </span></div>

<div><br></div><div><font face="trebuchet ms, sans-serif">Freeradius is sending it:</font></div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><div>(2) dailycounter : Sent Reply-Item for user hello, Type=Session-Timeout, value=60</div>

<div>(2)   [dailycounter] = ok</div></div><div><font face="trebuchet ms, sans-serif"><br></font></div><div><div>Sending Access-Challenge of id 232 from 10.1.1.2 port 135 to 27.33.228.125 port 47097</div><div><span style="white-space:pre-wrap">  </span>Session-Timeout = 60</div>

<div><span style="white-space:pre-wrap">  </span>EAP-Message = 0x010200061920</div><div><span style="white-space:pre-wrap">     </span>Message-Authenticator = 0x00000000000000000000000000000000</div><div><span style="white-space:pre-wrap">       </span>State = 0x543a9074553889da6f504855ab4e7a4b</div>

<div>(2) Finished request 2.</div></div><div><br></div><div>I did not put anything in the radreply for the user. When I did put Session-Timeout=60 in radreply, I still cannot see it in the NAS log. </div><div><br></div><div>

Is it my a problem with NAS configuration?</div><div><br></div><div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px">What should I do now?</span></div></div></blockquote><div><span style="font-family:trebuchet ms,sans-serif"><br>
</span></div><div><span style="font-family:trebuchet ms,sans-serif">The way FreeRADIUS works is that, it does not disconnect users him self. But rather tells the NAS to disconnect user. if i say that, how FreeRADIUS would tell NAS to disconnect user ? using REPLY ITEM. So put "Session-Timeout" in Reply as well. You said even if you add "Session-Timeout" in reply make no difference, no problem leave "Session-Timeout" in reply-item, it must to be there. And</span><span style="font-family:trebuchet ms,sans-serif"> you have more than one problem. 60 seconds are too less, minimum test should be done with 600 seconds for better results. <br>
<br></span></div><div><span style="font-family:trebuchet ms,sans-serif">FreeRADIUS is now fine. </span><span style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">Configure your NAS properly<br>
<br></span></span></div><div><span style="font-family:trebuchet ms,sans-serif">NOTE: Check item is for FreeRADIUS. reply item is for NAS. <br></span></div><div><span style="font-family:trebuchet ms,sans-serif"><br></span></div>
<div><span style="font-family:trebuchet ms,sans-serif">Thanks / Regards<br><br></span></div><div><span style="font-family:trebuchet ms,sans-serif">--RM <br><br><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:'trebuchet ms',sans-serif;font-size:13px">Jake He</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, May 13, 2014 at 5:12 PM, Arran Cudbard-Bell <span dir="ltr"><<a href="mailto:a.cudbardb@freeradius.org" target="_blank">a.cudbardb@freeradius.org</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div><br>
On 13 May 2014, at 08:46, * <<a href="mailto:zhex900@gmail.com" target="_blank">zhex900@gmail.com</a>> wrote:<br>
<br>
> You mean I need to upgrade to 3.0.3?<br>
<br>
</div>yes.<br>
<div><div><br>
Arran Cudbard-Bell <<a href="mailto:a.cudbardb@freeradius.org" target="_blank">a.cudbardb@freeradius.org</a>><br>
FreeRADIUS Development Team<br>
<br>
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2<br>
<br>
</div></div><br></div></div><div class="">-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></div></blockquote></div><br></div>
<br>-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></blockquote></div><br></div></div>