Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

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

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

    
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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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.