Iptables and counters

Posted by mehturt on Server Fault See other posts from Server Fault or by mehturt
Published on 2014-08-21T21:42:20Z Indexed on 2014/08/21 22:21 UTC
Read the original article Hit count: 150

Filed under:
|
|

I'm trying to use iptables counters with munin to monitor traffic of hosts on my local subnet. For each host I set up a rule like this:

iptables -I OUTPUT -d $ip

This should count the packets going from firewall to $ip, correct?

I found out that this does not seem to count all packets. I start tcpdump on my router (Linux) and I see packets to $ip that are not counted.

For example I check number of packets for rule to my phone IP. I start tcpdump, refresh Gmail on my phoone, I see packets in tcpdump's output but iptables rule counters are not incremented. Then I open a web page on the same phone and the counters are incremented.

What could be the reason?

© Server Fault or respective owner

Related posts about iptables

Related posts about nat