David Cannings
2004-01-19 13:31:42 UTC
I've taken a look at the iptables manual page but can't seem to see
anything that would suit what I want. I have a number of rules that I
grep for every five minutes, reading the packet/byte count then resetting
their totals by using --replace and --set-counters. At present, I know
that these rules will always be the ones at the top of my INPUT chain, so
I know their IDs will be 1, 2, 3 etc.
I want to do similar with other rules elsewhere in the chain but I can't
be sure that they'll always be number 12, for example. This makes
grepping for them a little harder. Would it be possible to have some
sort of "comment" field for each rule so that some sort of token or
unique ID for the rule could be inserted. That way, it would simply be a
case of "iptables -L -v | grep 'token'".
Whether such an idea would add extra overhead to processing I don't know.
I can also see that adding an extra column to the iptables output could
be troublesome for those with scripts that rely on the present format but
I'm sure it could be accomodated, somehow.
Thanks,
David
anything that would suit what I want. I have a number of rules that I
grep for every five minutes, reading the packet/byte count then resetting
their totals by using --replace and --set-counters. At present, I know
that these rules will always be the ones at the top of my INPUT chain, so
I know their IDs will be 1, 2, 3 etc.
I want to do similar with other rules elsewhere in the chain but I can't
be sure that they'll always be number 12, for example. This makes
grepping for them a little harder. Would it be possible to have some
sort of "comment" field for each rule so that some sort of token or
unique ID for the rule could be inserted. That way, it would simply be a
case of "iptables -L -v | grep 'token'".
Whether such an idea would add extra overhead to processing I don't know.
I can also see that adding an extra column to the iptables output could
be troublesome for those with scripts that rely on the present format but
I'm sure it could be accomodated, somehow.
Thanks,
David