Linux Netfilter discussions
 help / color / mirror / Atom feed
* counter target
@ 2023-08-25 21:06 Matt Zagrabelny
  2023-08-27 21:11 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Zagrabelny @ 2023-08-25 21:06 UTC (permalink / raw)
  To: netfilter

Greetings netfilter,

I have a question about the location of a "counter" statement.

I see from the wiki [0] that placing a counter for the default policy
comes *after* the policy:

table ip counter_demo {
    chain IN {
        type filter hook input priority filter; policy drop;

        protocol tcp counter
    }
}

That feels a little counterintuitive to place a counter after the
packet "appears" to have been dropped.

Thus, do I place other counter statements *after* their corresponding
netfilter stanzas:

table inet filter {
    chain input {
        # accept traffic originated from us
        ct state vmap {
            established: accept,
            related:     accept,
            invalid:     drop,
        }
        counter
    }
}

Or do I place the counter before:

table inet filter {
    chain input {
        counter

        # accept traffic originated from us
        ct state vmap {
            established: accept,
            related:     accept,
            invalid:     drop,
        }
    }
}

Or does it not matter?

Thanks for helping me understand.

Cheers,

-m

[0] https://wiki.nftables.org/wiki-nftables/index.php/Counters

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-31 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-25 21:06 counter target Matt Zagrabelny
2023-08-27 21:11 ` Pablo Neira Ayuso
2023-08-31 15:25   ` Matt Zagrabelny
2023-08-31 15:32     ` Pablo Neira Ayuso
2023-08-31 15:49       ` Matt Zagrabelny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox