我已经创建了 python auth 模块。尝试使用 radtest 执行测试时,回复为:
User-Password = "testing123"
NAS-IP-Address = 127.0.1.1
NAS-Port = 0
Message-Authenticator = 0x00
Cleartext-Password = "testing123"
Received Access-Accept Id 188 from 127.0.0.1:1812 to 0.0.0.0:0 length 48
ERX-Service-Activate:0 = "srs-local-ipoe"
如您所见,ERX-Service-Activate 只有一个零标记属性。
但是 radiusd -X 向我显示了另一个输出:
authorize - 'reply:ERX-Service-Activate:1' = 'srs-local-ipoe'
authorize - 'reply:ERX-Service-Activate:2' = 'srs-localnet-ipoe(110000)'
authorize - 'reply:ERX-Service-Activate:3' = 'srs-foreignnet-ipoe(110000,110000)'
authorize - 'config:Auth-Type' = 'Accept'
authorize - 'config:Cleartext-Password' = 'testing123'
如何获取所有 ERX-Service-Activate 标记属性。
Python构造回复:
reply = (('Framed-IP-Address', str(client.ipv4)),
('ERX-Service-Activate:1', 'srs-local-ipoe'),
('ERX-Service-Activate:2',
'srs-localnet-ipoe(%s)' % str(client.s_localnet)),
('ERX-Service-Activate:3',
'srs-foreign-ipoe(%s,%s)' % (str(client.s_foreign),
str(client.s_localnet))),)
Wireshark 中的 PS Reply 也只有一个 ERX-Service-Activate 属性。
答案1
freeradius 版本 3.0.17 中已修复此问题
另外回复应该稍微修改一下:
reply = (('Framed-IP-Address', str(client.ipv4)), ('ERX-Service-Activate:1', 'srs-local-ipoe'), ('ERX-Service-Activate:2', '+=', 'srs-localnet-ipoe(%s)' % str(client.s_localnet)), ('ERX-Service-Activate:3', '+=', 'srs-foreign-ipoe(%s,%s)' % (str(client.s_foreign), str(client.s_localnet))),)