session-timeout update

Radius related questions
Post Reply
konqueror
Posts: 2
Joined: 27 Dec 2018, 13:35

session-timeout update

Post by konqueror »

Hi guys,

First I want to thank you for this awesome soft.
And to the point - I use accel-ppp for pppoe with radius AAA. I have some prepaid users. When they connect, radius sends session-timeout and they disconnect when their prepaid period ends.
But when client pays I can't find a way to update the session-timeout without disconnecting the user. As I understand I have to use COA(dae-server).
Am I correct? And what is the correct way to do this?

Thank you in advance.
dimka88
Posts: 866
Joined: 13 Oct 2014, 05:51
Contact:

Re: session-timeout update

Post by dimka88 »

Hi, yes. Use DM/CoA, I think only reconnect user.
dae-server=x.x.x.x:port,secret
Specifies IP address, port to bind and secret for Dynamic Authorization Extension server (DM/CoA).
for example

Code: Select all

[radius]
dae-server=100.64.0.1:3799,testing123

Code: Select all

echo "Acct-Session-Id=55dd1a11e0546abc" |  radclient  100.64.0.1:3799 disconnect testing123
or

Code: Select all

echo "User-Name=1111" |  radclient 100.64.0.1:3799 disconnect testing123
konqueror
Posts: 2
Joined: 27 Dec 2018, 13:35

Re: session-timeout update

Post by konqueror »

Thank you for the quick answer. I am playing with this:

Code: Select all

echo 'Framed-IP-Address=10.1.2.3,Session-Timeout=1000' | radclient 10.2.3.4:3799 coa password
And it works without disconnecting client, which is my desired behavior. The only problem left is my freeradius. I activated coa and put this in "accounting":

Code: Select all

	update coa {
	       User-Name = "%{User-Name}"
	       Acct-Session-Id = "%{Acct-Session-Id}"
	       NAS-IP-Address = "%{NAS-IP-Address}"
	       Session-Timeout = "%{Session-Timeout}"
	}
But in debug:

Code: Select all

++update coa {
        expand: %{User-Name} -> test2
        expand: %{Acct-Session-Id} -> 5737aac0e237d0de
        expand: %{NAS-IP-Address} -> 10.2.3.4
        expand: %{Session-Timeout} -> 
++}
%{Session-Timeout} is empty. I guess I have to get its value from somewhere before putting it in accounting?

P.S. I think I found a way:

Code: Select all

	update coa {
	       User-Name = "%{User-Name}"
	       Acct-Session-Id = "%{Acct-Session-Id}"
	       NAS-IP-Address = "%{NAS-IP-Address}"
	       Session-Timeout = "%{sql:SELECT ( extract(epoch from end_period) - extract(epoch from now()) )::integer FROM users where users.username='%{User-Name}'}"
	}
It works for me. Is it a good way to achieve what I want?

And what is the default/recommended value for "acct-interim-interval"?

P.P.S. It works when decreasing Session-Timeout. When I want to increase it it sends the correct value to accel-ppp but it seems accel-ppp does not respect the increased value. Is it a bug or a feature?
Post Reply