网上转载:
环境:fedora 13或者centos 5
freeradius-server-2.1.10
mysql Ver 14.14 Distrib 5.1.48
# mysqladmin -uroot password 111111 --创建初始密码
# mysql -uroot -p111111
# mysql> create database radius; -- 创建radius 数据库
# mysql> quit;
# mysql -u root -p111111 radius < /etc/raddb/sql/mysql/schema.sql --radius安装路径
# mysql -u root -p111111 radius < /etc/raddb/sql/mysql/nas.sql
# mysql -u root -p111111 radius < /etc/raddb/sql/mysql/ippool.sql
# mysql -u root -p111111 radius < /etc/raddb/sql/mysql/wimax.sql --如果没有wimax.sql 就执行admin.sql授权
# mysql -u root -p111111
mysql> GRANT SELECT ON radius.* TO 'radius'@'localhost' IDENTIFIED BY 'radpass';
mysql> GRANT ALL on radius.radacct TO 'radius'@'localhost';
mysql> GRANT ALL on radius.radpostauth TO 'radius'@'localhost';
先加入一些组信息:
mysql> use radius;
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Auth-Type',':=','Local');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Service-Type','=','Framed-User');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Netmask','=','255.255.255.255');
mysql> insert into radgroupreply (groupname,attribute,op,value) values ('user','Framed-IP-Netmask',':=','255.255.255.0');
然后加入用户信息:
mysql> INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('sqltest', 'Password', 'testpwd');
然后把用户加到组里:
mysql> insert into radusergroup(username,groupname) values('sqltest','user');
mysql> select * from radcheck where UserName='sqltest';
mysql> quit;