使用两个身份验证类型 PAP 和 EAP 与 FreeRadius



我有使用MySQL存储数据的freeradius服务器。

以下是我的数据库

radcheck table
+-----+----------+--------------------+----+--------------+
| id  | username | attribute          | op | value        |
+-----+----------+--------------------+----+--------------+
| 474 | varun    | Cleartext-Password | := | sunshine3003 |
+-----+----------+--------------------+----+--------------+

radreply table
+----+----------+--------------+----+-------+
| id | username | attribute    | op | value |
+----+----------+--------------+----+-------+
|  1 | varun    | Fall-Through | =  | Yes   |
+----+----------+--------------+----+-------+

radgroupcheck table
+----+-----------+-----------+----+-------+
| id | groupname | attribute | op | value |
+----+-----------+-----------+----+-------+
|  1 | group1    | Auth-Type | := | PAP |
|  2 | eapgroup  | Auth-Type | := | EAP   |
+----+-----------+-----------+----+-------+

radusergroup table
+----------+-----------+----------+
| username | groupname | priority |
+----------+-----------+----------+
| varun    | eapgroup  |        1 |
| varun    | group1    |        2 |
+----------+-----------+----------+

我们有两个不同的客户端,它们使用两种不同的自由半径身份验证类型,一个使用PAP并在User-Password属性中发送密码。

另一个客户端用户EAP并以EAP-MessageMessage-Authenticator发送密码

我想要的是,当 PAP 无法进行身份验证或User-Password属性不存在时,它应该使用EAP作为Auth-Type,如果 radius 属性中不存在EAPMessage-Authenticator,它应该回复访问拒绝或身份验证失败消息。

任何帮助将不胜感激

您不应该手动设置control:Auth-Type。 此属性的存在是为了让authorize部分中的模块可以与服务器的其余部分通信应在authenticate部分中运行的身份验证类型。

为了根据属性设置Auth-Type,您应该在授权部分依次列出pap,eap等模块,它们将检查请求中是否具有必要的属性并确定正确的身份验证类型值。

如果要制定策略以将某些用户限制为某些类型的身份验证,请在回复列表(radgroupreply 表(中设置身份验证类型,并检查在授权部分末尾设置了哪种身份验证类型。

authorize {
eap
pap
sql
if (control:Auth-Type != reply:Auth-Type) {
reject
}
}

最新更新