netstat -i what is meant by the metric value of the given interface?

Peter Skirko picture Peter Skirko · Jan 3, 2012 · Viewed 8k times · Source

When using netstat -i you get output like the following sample:


  Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
  eth0       1500 0       214      0      0 0           139      0      0      0 BMRU
  eth1       1500 0       656      0      0 0            34      0      0      0 BMRU
  lo        16436 0         0      0      0 0             0      0      0      0 LRU

According to the Linux Network Administrator's Guide at http://tldp.org/LDP/nag2/x-087-2-iface.netstat.html

The MTU and Met fields show the current MTU and metric values for that interface. The RX and TX columns show how many packets have been received or transmitted error-free (RX-OK/TX-OK) or damaged (RX-ERR/TX-ERR); how many were dropped (RX-DRP/TX-DRP); and how many were lost because of an overrun (RX-OVR/TX-OVR).

What exactly is meant by the metric value for a given interface?

Answer

ugoren picture ugoren · Jan 3, 2012

It determines the preferred route, in case there are multiple routes to the same host. The OS will take the path with the lower metric.
It's normally something the routing daemon (if you use dynamic routing) worries about.