Request: show interfaces

Eugene Grosbein eugen at grosbein.net
Sat May 30 03:24:13 UTC 2020


30.05.2020 0:49, joe mcguckin wrote:

> It’s always bugged me that Unix doesn’t show as much information as a typical router 
> does about ethernet interface statistics.
> 
> What we really need is the equivalent of Cisco ’show interface’
> 
> This shows the bit rate, packet rate, count, all the various type of errors, etc.
> 
> Cisco allows a description field to be set for each interface, and that shows up also in a ’show int’ output.
> 
> I think these would be great features, considering how ofter FreeBSD is used for routers and firewalls.

We already have most of these values available.
Both rc.conf(5) and ifconfig(8) manual pages document how do you set and view
interface description with ifconfig and via SNMP.

"netstat -I em0 -dnW" shows total number of input/output packets, errors,
drops and collisions.

"netstat -I em0 -dnW 5" shows rates you mentioned per specified interval of 5 seconds.

Hardware-specific MAC-level counters generally exposed by driver(s) via sysctl:

# sysctl dev.bce.0 | wc -l
      66
# sysctl dev.igb.0 | wc -l
     187

There are too many values to include in single command output
and while I work with Cisco over 20 years, I don't really like its "show interface"
format because its too "fat". If you do, you can (almost) easily reproduce it
with custom script if you read ifconfig(8) and netstat(1) manual pages carefully.



More information about the freebsd-hackers mailing list