From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: nft show counter Date: Thu, 1 Apr 2021 20:21:04 +0200 Message-ID: <20210401182104.GG13699@breakpoint.cc> References: <20210331214053.GB13699@breakpoint.cc> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Frank Myhr Cc: Florian Westphal , Frank Wunderlich , netfilter@vger.kernel.org Frank Myhr wrote: > On 2021/03/31 17:40, Florian Westphal wrote: > > You could use a named counter and then fetch it via 'nft list counter > > inet tablenam countername'. > > This is the straightforward solution! > > Florian, is it correct that *all* counters are stateful objects, they're > just anonymous stateful objects if used in a rule without first declaring > them with a name? The wiki reads as if they're 2 separate things (I'm happy > to fix but want to check with you first): > > https://wiki.nftables.org/wiki-nftables/index.php/Counters The normal counters do not have a 'hidden' internal name. Thats also the reason why simple counters do not show up in 'nft list counters', they only exist in the context of the rule they are used in.