0

I tried searching elsewhere, but couldnt find anything relevant. So I thought I might give it a shot here.
Is there anyway I can exclude a certain IP Address from accounting? I have a file server running which shouldn't affect users usage stats.

Is there a way to do this?

4

1 回答 1

1

迟到的答案,但我们开始:

您可以使用 unlang 过滤 IP 地址,使用硬编码值或例如通过 SQL:

if ("%{Packet-Src-IP-Address}" != "10.16.1.1") {
    # do your usual stuff here
}

SQL:

if ("%{sql:SELECT COUNT(*) FROM accounting_excluded_nas WHERE ip == '%{Packet-Src-IP-Address}'}" == 0)

有关该语言的完整文档,请尝试“unlang”手册页。从这一点开始,有很多方法可以排除计费数据包,要么“拒绝”(不会发回计费响应数据包),要么将其余常规配置包装到 if 块中(如图所示以上)。

您也可以使用 RADIUS 属性 NAS-IP-Address,但不需要 NAS 将这些属性与其数据包一起发送。

(对于 IPv6,将 %{} 内的文本替换为 Packet-Src-IPv6-Address)

于 2012-05-25T19:27:22.890 回答