Determine ethernet speed in RHEL 6

47,016

Solution 1

Do NOT use mii-tool. It was last updated years ago and does not support anything over fast ethernet.

There are few ways you can determine ethernet speed. The most recommended one is

cat /sys/class/net/<interface>/speed

The output will be 10, 100, 1000, ...etc.

In fact you can get almost all data you need about your network card from /sys/class/net//

Another option (not sure why didn't work for you)

lspci | grep -iE --color 'network|ethernet'

01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

Solution 2

Please check this and this.

ethtool eth0

see the result and find the "speed" line, like this result:

Speed: 1000Mb/s
Share:
47,016

Related videos on Youtube

basin
Author by

basin

Updated on September 18, 2022

Comments

  • basin
    basin almost 2 years

    How to check whether eth0 has connection speed 10Mbit, 100Mbit or 1Gbit? I tried ethtool, but it says No data available. I also tried dmesg | grep -i duplex and it's empty.

    [root@dioptase ~]# lspci
    00:0a.0 Ethernet controller: Digital Equipment Corporation DECchip 21140 [FasterNet] (rev 20)
    
    [root@dioptase ~]# ethtool eth0
    Settings for eth0:
    No data available
    
    [root@dioptase ~]# ethtool -i eth0
    driver: tulip
    version: 1.1.15
    firmware-version:
    bus-info: 0000:00:0a.0
    
    [root@dioptase ~]# ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 00:15:5D:6F:1E:09
              inet addr:192.168.140.106  Bcast:192.168.140.255  Mask:255.255.255.0
              inet6 addr: 2a00:1120:0:1002:215:5dff:fe6f:1e09/64 Scope:Global
              inet6 addr: fe80::215:5dff:fe6f:1e09/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:95671897 errors:6 dropped:0 overruns:0 frame:6
              TX packets:16524440 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:23933711964 (22.2 GiB)  TX bytes:19761966217 (18.4 GiB)
              Interrupt:9 Base address:0xe000
    
    • Sreeraj
      Sreeraj over 9 years
      Looking at the error message, is this a VM?
    • basin
      basin over 9 years
      @Sree yes, hyper-v
    • R J
      R J over 9 years
      This does seem like a VM.
  • Jason Hobbs
    Jason Hobbs over 9 years
    Some network interfaces, like bridges, will give an "Invalid argument" error when you cat cat /sys/class/net/<interface>/speed. Also - isn't "Gigabit Network Connect" just a reflection of the device type, not its current link speed?
  • R J
    R J over 9 years
    Yes, you will see that on bridge and other interface type. The OP already identified the interface, eth0. The Gigabit part tells me the interface is 1000 Mbit/s.
  • Jason Hobbs
    Jason Hobbs over 9 years
    That the interface is capable of 1000 MBit/s, but not that it's running at that speed. It could be on a slower link. It will say Gigabit Network Connection there even if the link isn't up at all.
  • Jakob Bennemann
    Jakob Bennemann almost 8 years
    Please inline the most relevant information from links to avoid link-rot and to offer self-contained answers.
  • flow2k
    flow2k about 6 years
    The output of cat /sys/class/net/<interface>/speed has units of megabits/s? So 1000 is gigabit ethernet?
  • R J
    R J about 6 years
    Yes, that is correct.