centos搭建radius服务器
# 安装radius
yum install -y freeradius-utils freeradius
1
部署完成 ,启动FreeRadius调试模式。
radiusd -X
1
如果没有报错,就启动成功了
# 添加用户
vim users
1
#"John Doe" Auth-Type := Local, User-Password == "hello"
# Reply-Message = "Hello, %u"
改为
"test" Auth-Type := Local, User-Password == "123456"
Reply-Message = "Hello, %u"
1
2
3
4
5
6
7
2
3
4
5
6
7
# 测试连接
radtest test 123456 127.0.0.1 0 testing123
1
终端返回:
Sending Access-Request of id 161 to 127.0.0.1 port 1812
User-Name = "test"
User-Password = "123456"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=161, length=33
Reply-Message = "Hello, test"
1
2
3
4
5
6
7
2
3
4
5
6
7
# 权限访问
cd /etc/raddb
cp client.conf client.conf.back
vim client.conf
增加
client 192.168.1.0/24 {
secret = 123456
shortname = any
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# 命令
service radiusd start
service radiusd enable
1
2
2
上次更新: 2022/10/15, 15:19:25