2

I need to find the link speed of a NIC on a Linux machine without using elevated (root) privileges.

Normally I would just use ethtool, but that appears to require root privs.

One can "dmesg | grep eth" and check lines like:

igb 0000:01:00.0: eth0: igb: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX

...but will a message like this necessarily get logged every time the link speed changes (such as going from 1000 to 100 mbit due to a cable fault developing)?

Is there a better/easier way to do this? If it matters, these machines are running RHEL 6.6 and I can install any needed software.

5

Got an answer locally that works:

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

Interestingly, ethtool will show interface data without root privileges on some distributions but not others. The /sys/class... method seems to work everywhere I've tried.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.