微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从 FreeRADIUS 和 OpenLDAP 发送 VSA

如何解决从 FreeRADIUS 和 OpenLDAP 发送 VSA

这似乎很简单,但不幸的是,在查阅了大量文档后,它并不清楚,因此我们将不胜感激。

简而言之,我想返回一个 VSA 以响应身份验证请求。 VSA 是用于虚拟路由器的瞻博网络 VSA,对于供应商 ID 4874 显示为 26-1。在 LDAP 配置中,我有以下适用于标准 RADIUS 属性内容

update {
        control:Password-With-Header    += 'userPassword'
        reply:Reply-Message             := 'radiusReplyMessage'
        reply:Framed-IP-Address         := 'radiusFramedIPAddress'
        reply:Framed-IP-Netmask         := 'radiusFramedIPNetmask'
        reply:Framed-MTU                := 'radiusFramedMTU'
        #reply:vendor_Specific[1]       := 'radiusJuniperVirtualRouter'

        #  Where only a list is specified as the RADIUS attribute,#  the value of the LDAP attribute is parsed as a valuepair
        #  in the same format as the 'valuepair_attribute' (above).
        control:            += 'radiusControlAttribute'
        request:            += 'radiusRequestAttribute'
        reply:              += 'radiusReplyAttribute'
    }

返回

[root@ldapm01 sites-available]# radtest -x -4 -P udp testaccount2 password 127.0.0.1 1 testing123
Sent Access-Request Id 193 from 0.0.0.0:46100 to 127.0.0.1:1812 length 82
        User-Name = "testaccount2"
        User-Password = "password"
        NAS-IP-Address = 10.0.0.17
        NAS-Port = 1
        Message-Authenticator = 0x00
        Cleartext-Password = "password"
Received Access-Accept Id 193 from 127.0.0.1:1812 to 0.0.0.0:0 length 38
        Framed-IP-Address = 10.0.0.2
        Framed-IP-Netmask = 255.255.255.255
        Framed-MTU = 1500

所以 FreeRADIUS 和 LDAP 正在工作。我需要解决的是

#reply: := 'radiusJuniperVirtualRouter'

注意:可用的 juniper 字典仅支持供应商 ID 2636,因此我必须创建一个新的字典文件

解决方法

好的,我找到了答案,实际上很简单。这是在适当的字典中找到属性的名称并将其用作参考的问题。字典名称是唯一的,通常是字典名称后面的属性名称。 在我的例子中,我必须为我需要的企业 ID 搜索字典目录(Centos 7,/usr/share/freeradius),在我的例子中是 dictinary.erx(感谢供应商整合)的 4874。

这里是ldap配置

update {
    control:Password-With-Header    += 'userPassword'
    reply:Reply-Message             := 'radiusReplyMessage'
    reply:Framed-IP-Address     := 'radiusFramedIPAddress'
    reply:Framed-IP-Netmask     := 'radiusFramedIPNetmask'
    reply:Framed-MTU                    := 'radiusFramedMTU'
    reply:ERX-Virtual-Router-Name   := 'radiusVRF'

    #  Where only a list is specified as the RADIUS attribute,#  the value of the LDAP attribute is parsed as a valuepair
    #  in the same format as the 'valuepair_attribute' (above).
}

然后我还必须创建一个匹配的 LDAP 架构条目来支持附加值,在我的情况下,我只是通过添加以下内容扩展了 FreeRADIUS 架构

olcAttributeTypes: {65}( 1.3.6.1.4.1.11344.4.1.2.1.67 NAME 'radiusVRF' DESC 'requestItem: $GENERIC$' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

然后将其添加到 olcObjectClasses 列表的末尾

olcObjectClasses: {0}( 1.3.6.1.4.1.11344.4.3.2.1 NAME 'radiusprofile' DESC '' SUP top AUXILIARY MAY ( radiusArapFeatures $ radiusArapSecurity $ radiusArapZoneAccess $ radiusAuthType $
 radiusCallbackId $ radiusCallbackNumber $radiusCalledStationId $ radiusCallingStationId $ radiusClass $ radiusClientIPAddress $ radiusFilterId $ radiusFramedAppleTalkLink $ radiusFramedAppleTalkNetwork $
 radiusFramedAppleTalkZone $ radiusFramedCompression $ radiusFramedIPAddress $ radiusFramedIPNetmask $ radiusFramedIPXNetwork $ radiusFramedMTU $radiusFramedProtocol $ radiusAttribute $
 radiusFramedRoute $ radiusFramedRouting $ radiusIdleTimeout $ radiusGroupName $ radiusHint $ radiusHuntgroupName $ radiusLoginIPHost $ radiusLoginLATGroup $ radiusLoginLATNode $ radiusLoginLATPort $
 radiusLoginLATService $ radiusLoginService $ radiusLoginTCPPort $ radiusLoginTime $ radiusPasswordRetry $ radiusPortLimit $ radiusPrompt $ radiusProxyToRealm $ radiusRealm $ radiusReplicateToRealm $
 radiusServiceType $ radiusSessionTimeout $ radiusStripUserName $ radiusTerminationAction $ radiusTunnelClientEndpoint $ radiusProfileDN $ radiusSimultaneousUse $ radiusTunnelAssignmentId $
 radiusTunnelMediumType $ radiusTunnelPassword $ radiusTunnelPreference $ radiusTunnelPrivateGroupId $ radiusTunnelServerEndpoint $ radiusTunnelType $ radiusUserCategory $ radiusVSA $ radiusExpiration $
 dialupAccess $ radiusNASIpAddress $ radiusReplyMessage $ radiusControlAttribute $ radiusReplyAttribute $ radiusRequestAttribute $ radiusNasId $ radiusVRF ) )

现在它给了我以下内容

radtest -x -4 -P udp testaccount1 password 127.0.0.1 1 testing123

Sent Access-Request Id 24 from 0.0.0.0:49135 to 127.0.0.1:1812 length 82
        User-Name = "testaccount1"
        User-Password = "password"
        NAS-IP-Address = 10.0.0.17
        NAS-Port = 1
        Message-Authenticator = 0x00
        Cleartext-Password = "password"
Received Access-Accept Id 24 from 127.0.0.1:1812 to 0.0.0.0:0 length 48
        Framed-IP-Address = 10.0.0.1
        Framed-IP-Netmask = 255.255.255.255
        Framed-MTU = 1500
        juniper-unisphere-Virtual-Router = "12"

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?