How to update user's Session-Time attribute through Coa

Alan DeKok aland at
Wed Jun 27 19:04:16 CEST 2018

On Jun 27, 2018, at 12:56 PM, prometeotv at wrote:
> I am running freeradius ver on CentOS 6.0. I have
> configured freeradius with sql_counter module and all is working fine:
> users are disconnected when they reached the time or traffic
> assigned.
> Now my goal is to implement CoA on freeradius in order to
> update the Time (Session-Timeout) and Traffic (Mikrotik-Xmit-Limit)
> attribute, every time the NAS server (Mikrotik) sends the interim update
> packet, : how can I achieve that?

  You've done most of it correctly.

> I add this inside the accounting
> section of the file /ETC/SITE-AVAILABLE/DEFAULT
> #COA
> update coa {
> User-Name = "%{User-Name}"
> Acct-Session-Id = "%{Acct-Session-Id}"
> NAS-IP-Address = "%{NAS-IP-Address}"
> Framed-IP-Address =
> "%{Framed-IP-Address}"
> Session-Timeout = "%{Session-Timeout}"
> }

  What what's the value of Session-Timeout?

> but when the CoA packet is sent to the
> NAS the Session-Timeout attribute is set to 0 instead of to the residual
> credit time of the user.

  Read the debug output to see what's going on.

> I need that because if two people log-in
> simultaneosly with the same username, they should share the credit
> time/traffic instead, without CoA, they will both have the same
> credit
> Sorry for my English....I hope to have been clear

  It's fine.

  Alan DeKok.

More information about the Freeradius-Users mailing list