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.

1 Answer 1

6

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .