小编ouc*_*cil的帖子

nftables 计数器记录/存储在哪里,它们持续多久?

我正在尝试使用规则上的nftables命名来跟踪从一组特定 IP 地址(IPv4 和 IPv6)传输的总数据。counter我的目标是能够在一个日历月内跟踪这一总数,以便我可以根据使用情况进行计费。

相关规则如下:

add table stats
add counter stats os-traffic-4
add counter stats os-traffic-6
add chain inet stats INPUT { type filter hook input priority 0; }
add rule ip  stats INPUT ip  saddr 192.168.123.123 counter name os-traffic-4
add rule ip  stats INPUT ip  saddr 192.168.123.234 counter name os-traffic-4
add rule ip  stats INPUT ip  saddr 192.168.123.345 counter name os-traffic-4
add rule ip6 stats INPUT ip6 saddr 1234:1234:1234:1234:1234:1234:1234:1234 counter name os-traffic-6
add rule …
Run Code Online (Sandbox Code Playgroud)

networking traffic logging accounting nftables

5
推荐指数
1
解决办法
6118
查看次数

标签 统计

accounting ×1

logging ×1

networking ×1

nftables ×1

traffic ×1