0

When the following iptables command is executed

iptables -L -nvx | head
Chain INPUT (policy ACCEPT 283388 packets, 43757672 bytes)
    pkts      bytes target     prot opt in     out     source               destination
  614539 67414385   INPUT      all  --  *      *       0.0.0.0/0            0.0.0.0/0

We get the bytes transmitted over the particular rule in the iptables chain. Is there any log files, we fetch this data, just like we fetch the bytes transmitted over an interface ens33 from /sys/class/net/ens33/statistics/rx_bytes file.

1 Answer 1

0

iptables data can only be queried via kernel APIs e.g. using the iptables utility. No user visible files exist under /proc or /sys.

There are daemons which can collect/log/show this data though, e.g. ulogd, bpfmon and others.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.