DevOps Zone is brought to you in partnership with:

Rob Golding is a web applications developer from the UK, specializing in Python and Django with 3 years of experience in the trade as a systems administrator. Rob is a DZone MVB and is not an employee of DZone and has posted 8 posts at DZone. You can read more from them at their website. View Full User Profile

Graphing Traffic With Munin's IP Plugin

12.13.2012
| 3818 views |
  • submit to reddit

This is just a short post about using the Munin ip_ plugin to monitor traffic to and from particular hosts using iptables.

There are a number of posts that describe how to add the necessary rules to iptables for counting traffic to each host that you’re interested in. Unfortunately, they all suggest using rules which are the wrong way around. The correct rules should look like this (to monitor traffic to the host at 192.168.0.1):

-A INPUT -s 192.168.0.1
-A OUTPUT -d 192.168.0.1

All the resources I found quoted the rules above with the INPUT and OUTPUT chains switched, meaning no traffic would ever be recorded.

Published at DZone with permission of Rob Golding, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)