1 sudo apt‐get install freeradius freeradius‐mysql freeradius‐utils2 sudo ufw allow to any port 1812 proto udp3 sudo ufw allow to any port 1813 proto udp
并在调试模式下运行它
1 sudo freeradius ‐X
输出应该很长,并以这样的内容结尾
1 Listening on auth address * port 1812 bound to server default2 Listening on acct address * port 1813 bound to server default3 Listening on auth address :: port 1812 bound to server default4 Listening on acct address :: port 1813 bound to server default5 Listening on auth address 127.0.0.1 port 18120 bound to server inner‐tunnel6 Listening on proxy address * port 424637 Listening on proxy address :: port 554928 Ready to process requests
按Ctrl+C退出调试模式 。
2、检查目录下是否有schema.sql文件1 cd /etc/freeradius/mods‐config/sql/main/mysql2 find schema.sql
3 若提示没有找到该文件,可能是安装出错没有生成也可能是目录层次不同,可尝试下:find ‐name "schema.sql"若提示在目录下能找到这个文件则导入freeradius MySQL数据库方案:
1 sudo mysql ‐u root ‐p radius < /etc/freeradius/mods‐config/sql/main/mysql/schema.sql
3、检查创建的表:1 mysql ‐u root ‐p ‐e "use radius;show tables;"
会显示这样图形输出例子
1 +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+2 | Tables_in_radius |3 +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+4 | nas |5 | radacct |6 | radcheck |7 | radgroupcheck |8 | radgroupreply |9 | radpostauth |10 | radreply |11 | radusergroup |12 +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+
4、创建一个从SQL模块到/etc/freeradius/3.0/mods启用目录的符号链接:1 sudo ln ‐s /etc/freeradius/mods‐available/sql /etc/freeradius/mods‐enabled/
5、配置SQL模块并更改数据库连接参数以适合你的环境:1 sudo vim /etc/freeradius/mods‐enabled/sql
你的sql部分应该类似于下面的部分: 如果你有专用数据库服务器,请将localhost替换为源FreeRadius服务器的IP:
1 sql {2 driver = "rlm_sql_mysql"3 dialect = "mysql"4 # Connection info:5 server = "localhost"6 port = 33067 login = "radius"8 password = "123456"9 # Database table configuration for everything except Oracle10 radius_db = "radius"11 }12 # Set to ‘yes’ to read radius clients from the database (‘nas’ table)13 # Clients will ONLY be read on server startup.14 read_clients = yes1516 # Table to keep radius client info17 client_table = "nas"
6、然后更改/etc/freeradius/mods-enabled/sql的组权限:1 sudo chgrp ‐h freerad /etc/freeradius/mods‐available/sql2 sudo chown ‐R freerad:freerad /etc/freeradius/mods‐enabled/sql
重启freeradius服务:
1 sudo systemctl restart freeradius.service
最后,我们将在调试模式下运行FreeRADIUS以确保一切正常工作 。
7、首先停止当前运行的服务1 sudo systemctl stop freeradius.service
在调试模式下运行FreeRADIUS
1 sudo freeradius ‐X
输出的末尾应该是这样的
1 Listening on auth address * port 1812 bound to server default2 Listening on acct address * port 1813 bound to server default3 Listening on auth address :: port 1812 bound to server default4 Listening on acct address :: port 1813 bound to server default5 Listening on auth address 127.0.0.1 port 18120 bound to server inner‐tunnel6 Listening on proxy address * port 558737 Listening on proxy address :: port 460598 Ready to process requests
推荐阅读
- VPN在企业网络中的典型应用
- 如何编写优雅的 Java 代码
- 在hive任务中number of reducers的探讨
- 唐太宗李世民生平,唐太宗李世民在位
- 以诸葛瞻的口吻于公元263年冬在看完邓艾的将,诸葛亮为什么救邓艾
- 忍冬小说结局在起了么,忍冬花介绍与忍冬价格
- 精肉萝卜馅饼的做法
- 香甜土豆饼的做法
- 芝香油饼的做法
- 土豆洋葱饼的做法