2

I am trying to get statistics about virtual interfaces I have configured on my Linux box running Ubuntu. /proc/net/dev contains entries for lo and eth1, but I also have two virtual interfaces, lo:2 and eth1:1, which are not reported.

After some research, it seems like the virtual interfaces are just a layer on top of the kernel, but the kernel is still only handling the actual interfaces, so it cannot report statistics for the virtual interfaces.

I have read that using ipchains it is possible to get these statistics, but this introduces some significant administrative overhead which I would like to avoid.

Does anyone know how to get these statistics (received bytes, transmitted bytes, etc.) for virtual interfaces on Linux running Ubuntu?

Thanks!

JaredC
  • 121
  • 3
  • 1
    Virtual interfaces as you describe are deprecated. – MikeyB Aug 05 '11 at 20:25
  • @MikeyB Can you explain what you mean, or give a link to the correct undeprecated link? I can't seem to find any other way of setting up virtual interfaces. – JaredC Aug 07 '11 at 06:49
  • 1
    The new iproute2 utilities are what you should be using to set up additional IPs. (I.e.: ip addr add 10.23.54.67/24 dev eth0). Kevin is correct; you need to use iptables for accounting. – MikeyB Aug 07 '11 at 12:46

1 Answers1

2

I don't think it is possible without adding in a layer like iptables/ipchains. If anything could get the data netstat would, and netstat -ian will show you "no statistics available" for virtual interfaces.