有人能给我一个提示吗,如何修改Freeradius从外部脚本读取其他属性。
我有这个
update control {
Auth-Type := `/usr/bin/php -f /web/auth.php '%{NAS-Identifier} %{Calling-Station-Id}'`
}但是现在的回复可以是只允许访问或拒绝,但是我也想设置一些属性,更像是对这个用户的带宽限制。
输出
Accept
WISPr-Bandwidth-Max-Up: xxx
WISPr-Bandwidth-Max-Down: xxx
WISPr-Redirection-URL: http://google.com我能做到这一点?
系统: Ubuntu 14.04
radiusd: FreeRADIUS版本2.2.5,用于主机x86_64未知-linux-gnu,构建于2014年8月6日15:08:48
更新
preacct和accounting部分怎么样?我看到,一旦路由器被重新启动,它必须保持呼叫站在“头脑”,并重新认证,一旦它将启动。可以添加
accounting {
exec
update control {
Auth-Type := "%{reply:Auth-Type}"
}
...
}那里?
发布于 2014-10-18 20:55:58
Hm,这不是版本2的有效语法。您需要修改raddb/modules/exec并在授权部分调用它。
第2版
对于所需的exec模块配置:
wait = yes
program = "/usr/bin/php -f /web/auth.php '%{NAS-Identifier} %{Calling-Station-Id}'"
output_pairs = reply然后经授权:
authorize {
exec
update control {
Auth-Type := "%{reply:Auth-Type}"
}
...
}然后将脚本输出修改为:
Auth-Type = Accept
WISPr-Bandwidth-Max-Up = xxx
WISPr-Bandwidth-Max-Down = xxx
WISPr-Redirection-URL = http://google.com3版
Version 3支持类似于您发布的属性赋值,但它将是:
update {
control: += `/usr/bin/php -f /web/auth.php '%{NAS-Identifier} %{Calling-Station-Id}'`
}然后将脚本输出修改为:
Auth-Type = Accept
reply:WISPr-Bandwidth-Max-Up = xxx
reply:WISPr-Bandwidth-Max-Down = xxx
reply:WISPr-Redirection-URL = http://google.comhttps://stackoverflow.com/questions/26442693
复制相似问题