freeradius rlm_python タグ付き属性

freeradius rlm_python タグ付き属性

Python 認証モジュールを作成しました。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 にはゼロ タグの付いた属性が 1 つだけあります。

しかし、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))),)

PS Wireshark の Reply にも ERX-Service-Activate 属性が 1 つだけあります。

答え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))),)

関連情報