I have machines with one interface eth0 with multiple different IP addresses attached to it (255) to be exact, interfaces look like this eth0:1, eth0:2 ...eth0:254.

I want to monitor the traffic for each IP whit Prometheus + Grafana (or at least visualize it in Grafana).

So far I managed to get the overall traffic of the eth0 interface. I tried with SNMP, but still I can get overall traffic only. I also looked up how iotop calculates traffic of each IP and it looks like it opens each packet and check the ip address inside of it.

Using Ubuntu 18.04.

  • Those are not virtual interfaces, there is only eth0 with 255 IP addresses on it. It's been more than a decade since Linux did anything like separate virtual interfaces for these old-style aliases. They are simply extra IP addresses on the same interface, with a human readable label eth0:1 eth0:2 etc. You probably will have to check the IP address of each packet to monitor traffic by IP address. – Michael Hampton Dec 6 '18 at 14:58
  • @MichaelHampton I didn't know that sorry, I edited my question. Is there a way to separate those ips to different interfaces for easy monitoring? – AsenM Dec 6 '18 at 15:40
  • I don't know of any way to do that, but perhaps someone else will come up with something creative. – Michael Hampton Dec 6 '18 at 15:42
  • @MichaelHampton according to this linuxconfig.org/configuring-virtual-network-interfaces-in-linux this is in fact a virtual interface? – AsenM Dec 6 '18 at 15:54
  • Nope, that tutorial is wrong. It was even wrong the day it was written. Anything that advises you to use ifconfig can be presumed to be wrong, or at least obsolete. To see what your interface really looks like, run ip addr. – Michael Hampton Dec 6 '18 at 15:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.