there is an alternative for command
iptables -L -n -v
in nftables ?? I need the counter of packages that tomb on my firewall.
nftables does not automatically create counters for rules, but if you have a rule with a counter then they can be displayed with nft list ruleset
.
So if I have a ruleset like this.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
...
# icmp
ip protocol icmp counter accept
ip6 nexthdr icmpv6 counter accept
}
}
I get the output of nft list ruleset
that looks liek this.
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
...
ip protocol icmp counter packets 22040 bytes 781548 accept
ip6 nexthdr ipv6-icmp counter packets 67 bytes 4824 accept
}
}