Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hello I have configured MRTG for bandwidth monitoring, and seems to work, now, how can i configure MRTG to monitoring IP aliases? I mean with ifconfig:




eth0:1 and eth0:2 are aliases

For the real phisic interface /etc/mrtg.cfg is as follow:

Target[localhost_eth0]: #eth0 public@localhost

SetEnv[localhost_eth0]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0"

MaxBytes[localhost_eth0]: 1250000

Title[localhost_eth0]: Traffic Analysis for eth0

PageTop[localhost_eth0]: Traffic Analysis for eth0

For IP aliases do I just need to configure as follows

Target[localhost_eth0:1]: #eth0:1 public@localhost

SetEnv[localhost_eth0:1]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0:1"

MaxBytes[localhost_eth0:1]: 1250000

Title[localhost_eth0:1]: Traffic Analysis for eth0:1

PageTop[localhost_eth0:1]: <h1>Traffic Analysis for eth0:1</h1>

Thanx in advance

share|improve this question
up vote 0 down vote accepted

I don't believe you can do what you are trying to do, at least how you're wanting to do it.

I don't believe Linux performs per-address packet accounting, only per-interface. Since eth0:X are really all the same interface, just different addresses on it, they will all be accounted for in the eth0 statistics.

What you could do is look into how the firewall stuff works. Chances are there is a way to count packets/bytes there, and you could set up rules to count each alias. You could then query those counters and generate your graphs. However, I doubt MRTG will do that out of the box for you.

Check out which seems to be on topic.

share|improve this answer
Hello Michael, fist of all i want thank you, 'cause your answer is pretty useful. I'm coming from FreeBSD and Linux is just a new system for me, but the script that you have signaled is simple to understand. So, what i was looking for is a monitoring system without mysql and also snmpd, with iptables i can do what i need. I'm just tuning my system and i can say that's working very well. Also, with this idea, i can monitor IP aliases nor IP and ports for every service. Great! – xer Nov 26 '09 at 8:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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