我在 docker 容器中安装了 FreeRADIUS,Mysql
i installed FreeRADIUS , Mysql inside docker Container
我在 docker 容器中安装了 FreeRADIUS ,Mysql
我把端口1812、1813、3306暴露在外面。
我将数据库导入到 mysql 。
我将这些行插入到数据库
INSERT INTO nas VALUES (NULL , '0.0.0.0/0', 'myNAS', 'other', NULL , 'mysecret', NULL , NULL , 'RADIUS Client');
INSERT INTO radcheck (username, attribute, op, value) VALUES ('thisuser', 'User-Password', ':=', 'thispassword');
INSERT INTO radusergroup (username, groupname, priority) VALUES ('thisuser', 'thisgroup', '1');
INSERT INTO radgroupreply (groupname, attribute, op, value) VALUES ('thisgroup', 'Service-Type', ':=', 'Framed-User'), ('thisgroup', 'Framed-Protocol', ':=', 'PPP'), ('thisgroup', 'Framed-Compression', ':=', 'Van-Jacobsen-TCP-IP');
我停止了 freeradius ==> service freeradius stop
我正在使用调试模式 ==> freeradius -X
当在同一容器的另一个终端中使用此命令时 ==> radtest thisuser thispassword 127.0.0.1 0 mysecret
输出:服务器接受了请求
但是当之前的命令在另一台机器上时
服务器没有看到请求,在另一台机器上的输出是“无响应”
IN 等 IN freeradius IN radiusd.conf 文件中的注释:
listen {
type = auth
ipaddr = *
port = 0 }
listen {
ipaddr = *
port = 0
type = acct }
我该如何解决?
将行添加到 sql 数据库是不够的。您需要在 mods-available/sql
中配置您的 sql 实例以匹配您的本地数据库,在 mods-available/sql
中取消注释 read_clients
,并在实例化部分列出 sql 模块radiusd.conf
以确保在其中一个虚拟服务器的其他地方未引用它时加载它。
进行这些更改后,重新启动服务器。 SQL 模块应该在启动时读取客户端列表。检查调试输出 freeradius -X
以确保 SQL 模块可以连接到您的数据库,并成功读取 NAS 条目。
您的本地连接之所以有效,是因为服务器附带的 clients.conf
文件中包含一个本地主机的客户端条目。
我通过在 UDP 协议 -p 1813:1813/udp -p 1812:1812/udp
中公开端口解决了这个问题
我在 docker 容器中安装了 FreeRADIUS ,Mysql 我把端口1812、1813、3306暴露在外面。 我将数据库导入到 mysql 。 我将这些行插入到数据库
INSERT INTO nas VALUES (NULL , '0.0.0.0/0', 'myNAS', 'other', NULL , 'mysecret', NULL , NULL , 'RADIUS Client');
INSERT INTO radcheck (username, attribute, op, value) VALUES ('thisuser', 'User-Password', ':=', 'thispassword');
INSERT INTO radusergroup (username, groupname, priority) VALUES ('thisuser', 'thisgroup', '1');
INSERT INTO radgroupreply (groupname, attribute, op, value) VALUES ('thisgroup', 'Service-Type', ':=', 'Framed-User'), ('thisgroup', 'Framed-Protocol', ':=', 'PPP'), ('thisgroup', 'Framed-Compression', ':=', 'Van-Jacobsen-TCP-IP');
我停止了 freeradius ==> service freeradius stop 我正在使用调试模式 ==> freeradius -X 当在同一容器的另一个终端中使用此命令时 ==> radtest thisuser thispassword 127.0.0.1 0 mysecret
输出:服务器接受了请求
但是当之前的命令在另一台机器上时
服务器没有看到请求,在另一台机器上的输出是“无响应”
IN 等 IN freeradius IN radiusd.conf 文件中的注释:
listen {
type = auth
ipaddr = *
port = 0 }
listen {
ipaddr = *
port = 0
type = acct }
我该如何解决?
将行添加到 sql 数据库是不够的。您需要在 mods-available/sql
中配置您的 sql 实例以匹配您的本地数据库,在 mods-available/sql
中取消注释 read_clients
,并在实例化部分列出 sql 模块radiusd.conf
以确保在其中一个虚拟服务器的其他地方未引用它时加载它。
进行这些更改后,重新启动服务器。 SQL 模块应该在启动时读取客户端列表。检查调试输出 freeradius -X
以确保 SQL 模块可以连接到您的数据库,并成功读取 NAS 条目。
您的本地连接之所以有效,是因为服务器附带的 clients.conf
文件中包含一个本地主机的客户端条目。
我通过在 UDP 协议 -p 1813:1813/udp -p 1812:1812/udp
中公开端口解决了这个问题