[RADIATOR] Radiator+Mikrotik

Mahmoud Abdelsalam m.abdelsalam at wimd.com.kw
Mon Dec 8 02:16:03 CST 2014


Hello all,

As Mikrotik doesn't support COA for PPPoE, so I used Disconnect-Request, the hook script will send Disconnect-Request to Mikrotik once the session exceeds the quota, here is how i send Disconnect-Request:

  my @coa_attrs = ("User-Name=$user_name", "Acct-Session-Id=$sess_id", "Framed-IP-Address=$framed_ipaddress");
    my @cmd_args = ("-noacct", "-noauth", "-time","-code", "Disconnect-Request");
           push @cmd_args, ("-trace", "4", "-bind_address", "0.0.0.0", "-auth_port", "3799", "-secret", "bla", "-s", "10.11.11.2");
           my @cmd = ("radpwtst");
           system (@cmd, @cmd_args, @coa_attrs);

This works fine but the problem is that user can't re-authenticate again because it reaches Maxsessions although I have this in my config file:

<SessionDatabase SQL>

Identifier      tamesql
DBSource        dbi:ODBC:IRONMAN
DBUsername      user
DBAuth          pass

         AddQuery        insert into RADONLINE \


         (USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, NASPORTTYPE, SERVICETYPE) \
         values \
         ('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', %{Timestamp}, '%{Framed-IP-Address}', '%{NAS-Port-Type}', '%{Service-Type}')

         DeleteQuery     delete from RADONLINE where USERNAME='%n' and NASIDENTIFIER='%N' and NASPORT=%{NAS-Port}

         ClearNasQuery   delete from RADONLINE where NASIDENTIFIER='%N'

         CountQuery      select NASIDENTIFIER, NASPORT, ACCTSESSIONID, FRAMEDIPADDRESS from RADONLINE where USERNAME='%n'

</SessionDatabase>
   

The user would successfully authenticate again when I manually remove the session from RADONLINE by executing the DeleteQuery.

Best Regards,

Mahmoud Abdelsalam.



More information about the radiator mailing list