我们想通过FreeRadius设置StrongSwan VPN进行身份验证。除此之外,我们还要基于AD组为用户分配不同的子网。 StrongSwan在访问接受回复中使用class属性(https://wiki.strongswan.org/projects/strongswan/wiki/EapRadius)。
据我所知,可以在FreeRadius中使用自定义属性来存储在答复/代理/控制…过程中使用的数据,并将其发送回StrongSwan。
[不幸的是,这在我们的FreeRadius环境中不起作用,并且custom属性保持为空。但是,可以访问回复列表中已经存在的属性。
例如,此配置发送回空的变量回复消息。
/ etc / raddb / dictionary:
ATTRIBUTE test 3000 string
/ etc / raddb / users
DEFAULT test = “TESTTEST”
/etc/raddb/sites-enabled/default
post-auth {
...
update reply {
Reply-Message := "%{control:test}"
}
…
}
日志输出:
(11) [exec] = noop
(11) policy remove_reply_message_if_eap {
(11) if (&reply:EAP-Message && &reply:Reply-Message) {
(11) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
(11) else {
(11) [noop] = noop
(11) } # else = noop
(11) } # policy remove_reply_message_if_eap = noop
(11) update reply {
(11) EXPAND %{control:test}
(11) -->
(11) Reply-Message :=
(11) } # update reply = noop
(11) } # post-auth = noop
(11) Sent Access-Accept Id 5 from 127.0.0.1:1812 to 127.0.0.1:50913 length 0
(11) MS-MPPE-Recv-Key = 0xd23e4723df9ff904741b91827518aaa48dcbca27204024965d37fdb6bece0270
(11) MS-MPPE-Send-Key = 0x4e7de0fc944a5114ab435df43fa943901870741a86571e3ccddef11b82e406e1
(11) EAP-Message = 0x03050004
(11) Message-Authenticator = 0x00000000000000000000000000000000
(11) User-Name = "raduser"
(11) Reply-Message := ""
(11) Finished request
FreeRADIUS版本3.0.19
根据本指南,以上配置应起作用:
我们有什么想念的吗?预先感谢。
您的回复消息的格式应为回复消息:=“你好,%{用户名}”
在您的配置文件中,您定义了DEFAULT test =“ TESTTEST”,但在回复消息中您提到了“%{control:test}”。
请尝试一下。