When are iptables bytes counters cleared?

When are iptables byte counters reset? On reboot or other rotation?


Solution 1:

On reboot, or whenever you ask them to be cleared with the -Z option to iptables.

Solution 2:

On reboot, when -Z is called or when a table is flushed (-F). Counters are also reset if you run "/etc/init.d/iptables stop" on RHEL or CentOS (because it flushes all default chains).