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

I am looking for a way to see the number of Ethernet broadcast frames transmit/received by the network interfaces.
I am familiar with many Linux commands,procs and options to get interface statistics (ifconfig , nstat (which shows ip broadcasts), /proc/net/dev , ifstat etc...).
For example /proc/net/dev shows received Multicast, but there is no reference for broadcasts.
Is there a standard way to see it ?

share|improve this question
add comment

1 Answer

You can try ethtool:

ethtool -S <NIC name>

But not all of drivers is support for statistic, read manpage of ethtool for more details.

Updated

The solution is looking at /proc/net/netstat, but it is not in human readable. Using some awk to manipulate it:

cat /proc/net/netstat | \ 
awk '(f==0) { i=1; while ( i<NF) {n[i] = $i; i++ }; f=1; next} \ 
(f==1){ i=1; while ( i<NF){ printf "%s = %d\n", n[i], $i; i++}; f=0}' | \ 
grep Bcast

Output in my machine:

InBcastPkts = 171
OutBcastPkts = 17
InBcastOctets = 11856
share|improve this answer
    
I tried this as well, but there are no broadcasts counter. –  Kimel Jul 10 '13 at 14:36
    
Do you see any line contain tx_broadcast or rx_broadcast –  Gnouc Jul 10 '13 at 14:38
    
No, I don't, maybe it is related to interface driver ? –  Kimel Jul 10 '13 at 14:41
    
So I looked at my driver code, I see it doesn't count broadcasts. but is there other Linux generic interface for network stats (including broadcasts) ? –  Kimel Jul 10 '13 at 14:53
    
Thanks! Looks good (sorry I can't vote up-need 15 rep for that :)) –  Kimel Jul 10 '13 at 15:08
show 1 more comment

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.