2

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

eth0:1

eth0:2

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="xxx.xxx.xxx.xxx" 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="xxx.xxx.xxx.xxx" 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

xer
  • 43

1 Answers1

0

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 https://lists.oetiker.ch/pipermail/mrtg/2003-May/024190.html which seems to be on topic.