开源radius服务端软件freeradius,在Ubuntu 16.10 server版上的安装命令:
sudo apt-get install freeradius
配置文件目录位于/etc/freeradius/3.0/中。首先修改users认证用户配置文件,查找 steve Cleartext-Password :="testing" (73行), 取消该行的注释。另外为测试方便,可在文件的末尾(# On no match, the user is denied access.)此行之后,加入一条所有前文未匹配用户都可认证成功的配置:
214 DEFAULT Auth-Type := "Accept"
215 Reply-Message = "All user accepted."
保存之后,可使用radtest命令,测试freeradius是否安装配置成功。接收到Access-Accept报文说明配置成功。
radtest steve testing localhost 0 testing123
修改clients.conf文件,创建radius客户端配置,如下创建一个test_client客户端,IP地址为192.168.0.100,访问秘钥为123456。
client test_client {
ipaddr = 192.168.0.100
secret = 123456
}
如未配置radius client,会导致一下错误提示,服务端使用freeradius -X以调试模式启动,可现实错误信息:
Tue Jun 5 09:46:53 2018 : Error: Ignoring request to auth address * port 1812 bound to server default from unknown client 192.168.0.100 port 32941 proto udp
错误信息也可查看radius日志文件获取信息。
sudo apt-get install freeradius
配置文件目录位于/etc/freeradius/3.0/中。首先修改users认证用户配置文件,查找 steve Cleartext-Password :="testing" (73行), 取消该行的注释。另外为测试方便,可在文件的末尾(# On no match, the user is denied access.)此行之后,加入一条所有前文未匹配用户都可认证成功的配置:
214 DEFAULT Auth-Type := "Accept"
215 Reply-Message = "All user accepted."
保存之后,可使用radtest命令,测试freeradius是否安装配置成功。接收到Access-Accept报文说明配置成功。
radtest steve testing localhost 0 testing123
修改clients.conf文件,创建radius客户端配置,如下创建一个test_client客户端,IP地址为192.168.0.100,访问秘钥为123456。
client test_client {
ipaddr = 192.168.0.100
secret = 123456
}
如未配置radius client,会导致一下错误提示,服务端使用freeradius -X以调试模式启动,可现实错误信息:
Tue Jun 5 09:46:53 2018 : Error: Ignoring request to auth address * port 1812 bound to server default from unknown client 192.168.0.100 port 32941 proto udp
错误信息也可查看radius日志文件获取信息。
cat /var/log/freeradius/radius.log