1、查看/etc/raddb/sites-enabled/default文件,去掉注释和空行
#grep -v "#" /etc/raddb/sites-enabled/default | tr -s '\n'
找到authorize节,内容类似如下:
authorize {
filter_username
preprocess
chap
suffix
eap {
ok = return
}
files
expiration
logintime
pap
Autz-Type New-TLS-Connection {
ok
}
}
2、filter_username在/etc/raddb/policy.d目录下的filter文件中定义
#more /etc/raddb/policy.d/filter
3、下面测试一个filter_username中的if条件
if (&User-Name =~ / /) {
update request {
&Module-Failure-Message += 'Rejected: User-Name contains whitespace'