Hello,<div><br></div><div>I am new to FreeRADIUS and am trying to implement QoS policing using FreeRADIUS, where the RADIUS server assigns users QoS policies by usergroup membership. The server monitors usage, and throttles a user's bandwidth by originating a CoA assigning the throttled group if he exceeds the data cap defined for his group.</div>
<div><br></div><div>I have data usage being calculated by a Perl script - I define a group's data cap in the radgroupcheck table, and reference it using</div><div><br></div><div>$RAD_CHECK{'Data-Cap'}<br></div>
<div><br></div><div>I am able to run the script correctly in the authorize section, but when calling it from the accounting section, it does not grab the value, and just designates the cap as 0, causing all future comparisons to conclude the user is over the cap. </div>
<div><br></div><div>It appears that in the accounting section, $RAD_CHECK does not reference the radgroupcheck table. I have worked around this by hardcoding data caps for usergroups in the Perl script, but I would like to store these caps in a SQL table so they can easily be modified in the future without having to touch the FreeRADIUS config. </div>
<div><br></div><div>How do I reference radgroupcheck from the accounting section of my Perl script to pull these values?</div><div><br></div><div>Here is a portion of my workaround code:</div><div><br></div><div><div>sub accounting {</div>
<div> my $Group1_cap = 5368709120;</div><div> # define other caps here: $Group2_cap, $Group3_cap, etc.</div><div> my $cap = 0;</div><div><br></div><div> if ($RAD_CHECK{'Group-Name'} = "Group1") {</div>
<div> $cap = $Group1_cap;</div><div> }</div><div><br></div><div> # <b>I would like to replace $cap with $RAD_CHECK{'Data-Cap'}, but this does not pull values defined in radgroupcheck</b></div>
<div> $RAD_CHECK{'Avail-Bytes'} = $cap - $RAD_CHECK{'Used-Bytes'};</div><div><br></div><div> if ($RAD_CHECK{'Avail-Bytes'} < 0) {</div><div> # usage cap exceeded</div>
<div> return RLM_MODULE_NOOP;</div><div> }</div><div><br></div><div> return RLM_MODULE_UPDATED;</div><div>}</div></div><div><br></div><div>Thank you in advance,</div><div><br></div><div>Amanda</div>