How to get the speed of a network card on the command line?

3

I am trying to see what the speed of some network cards on a remote server. Our reporting software says they are 10Mbps, but I am sure that is wrong they should be 1Gbps. Our monitoring software uses SNMP to query the servers, perhaps the servers are reporting information incorrectly.

ifconfig does not report what the speed of the devices are. How can I see what the currently configured speed of the cards are.


Updated

When I ran the commands mii-tool and ethtool I got the following errors. We are running Centos5 on a xen virtual machine.

$ mii-tool -v
SIOCGMIIPHY on 'eth0' failed: Operation not supported
SIOCGMIIPHY on 'eth1' failed: Operation not supported
no MII interfaces found
$ ethtool eth1 Settings for eth1:
Link detected: yes
$ ethtool eth0
Settings for eth0:
Link detected: yes

I notice the ethtool on my personal computer brings up a lot more information.

nelaaro

Posted 2012-04-04T08:04:58.683

Reputation: 9 321

Answers

4

use ethtool. It will show you the current negotiated value and the available values.

ethtool eth0

Keith

Posted 2012-04-04T08:04:58.683

Reputation: 7 263

2

Perhaps the supposed error in your reporting software comes from that it internally uses mii-tool and then parses the output. This was some sort of standard up until quite a few years ago, and mii-tool is now deprecated since it lacks support for most (all?) Gbps configurations.

As said in Keith's answer: use ethtool instead; it's continuously updated. I just wanted to give some plausible background to the reporting error, and a possible way of fixing the problem if you have access to the code.

Daniel Andersson

Posted 2012-04-04T08:04:58.683

Reputation: 20 465