sending POD for PPPoe

J@g@dee5h djfueese at gmail.com
Wed Sep 16 13:03:11 CEST 2015


Hi Randeep,

You can't do like this. You need to mention exec script in
mods-enabled/exec and mention the script path in that file.

example

exec test {
        wait = no
        input_pairs = request
        shell_escape = yes
        output = none
        timeout = 10
        program: /root/testing.sh
}


On Wed, Sep 16, 2015 at 12:15 PM, Randeep <randeep123 at gmail.com> wrote:

> Hi Alan,
>
> We have both pppoe and hotspot services. If the user reaches the max data
> limit we are applying fup limit by sending a coa update.
>
> But with pppoe coa  is not working. So we implemented the following logic.
>
> If the user exceeded the limit, then we will check whether its pppoe or
> hotspot. If it is pppoe we are sending disconnect.
>
>         update control    {
>         #sum of the AcctInputOctets+AcctOutputOctets for this month.(From
> the first day of the current month to till date)
>         Tmp-Integer-0 := "%{sql:SELECT
> (SUM(acctinputoctets)+SUM(acctoutputoctets)) AS Total FROM radacct where
> radacct.username='%{User-Name}'}"
>         #Value of Max-Data from the radgroupcheck for the group of the user
>         Tmp-Integer-1 := "%{sql: SELECT radgroupcheck.value FROM
> radusergroup INNER JOIN radgroupcheck ON radusergroup.groupname =
> radgroupcheck.groupname WHERE  radusergroup.username='%{User-Name}' AND
>  radgroupcheck.attribute='Max-Data'}"
>         Tmp-String-1 := "%{sql: SELECT radgroupcheck.value FROM
> radusergroup INNER JOIN radgroupcheck ON radusergroup.groupname =
> radgroupcheck.groupname WHERE  radusergroup.username='%{User-Name}' AND
>  radgroupcheck.attribute='Mikrotik-Rate-Limit'}"
>         Tmp-String-3 = "%{sql:select calledstationid from radacct where
> acctsessionid='%{Acct-Session-Id}'}"
> }
>         if ("%{control:Tmp-Integer-0}" > "%{control:Tmp-Integer-1}") {
> #Added these to update COA for hotspot and disconnect for PPPOE
>     if ("%{control:Tmp-String-3}" == "hotspot1"){
>     update coa {
>     User-Name = "%{User-Name}"
>     Acct-Session-Id = "%{Acct-Session-Id}"
>     NAS-IP-Address = "%{NAS-IP-Address}"
>     Framed-IP-Address = "%{Framed-IP-Address}"
>     Mikrotik-Rate-Limit = "%{control:Tmp-String-1}"
>       }
>     }
>     else {
>     echo "Acct-Session-Id=\"%{Acct-Session-Id}\"" >
> /tmp/\"%{User-Name}\".txt
>     echo "User-Name=\"%{User-Name}\"" >> /tmp/\"%{User-Name}\".txt
>     echo "NAS-IP-Address=\"%{Framed-IP-Address}\"" >>
> /tmp/\"%{User-Name}\".txt
>     Secret= `grep "%{NAS-IP-Address}" /usr/local/etc/raddb/clients.conf -b2
> | grep secret |awk '{print $4}' `
>     cat "/tmp/\"%{User-Name}\".txt" | radclient -x "%{NAS-IP-Address}":3799
> disconnect "$Secret"
>     }
>   }
>
> But when running radiusd -XXX its giving the following error.
> Wed Sep 16 12:14:04 2015 : Error:
> /usr/local/etc/raddb/sites-enabled/default[623]: Expecting section start
> brace '{' after "echo Acct-Session-Id="%{Acct-Session-Id}""
> Wed Sep 16 12:14:04 2015 : Error: Errors reading or parsing
> /usr/local/etc/raddb/radiusd.conf
>
> Please help
>
> Regards,
> Randeep
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list