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!

link|improve this question
1  
belongs to unix.stackexchange.com or askubuntu.com ? – Brian Clozel Nov 30 '10 at 16:29
or indeed serverfault.com ? – aix Nov 30 '10 at 16:41
Virtual interfaces as you describe are deprecated. – MikeyB Aug 5 '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 7 '11 at 6:49
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 7 '11 at 12:46
feedback

migrated from stackoverflow.com Nov 30 '10 at 16:42

This question came from our site for professional and enthusiast programmers.

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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