You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to Check Network Card Speed and Duplex Mode in Linux

Practice



So there we are, working away in Linux, using ifconfig to configure IP addresses and netmasks, and we can even check whether there's a link through it. But here's the catch — unlike FreeBSD, on Linux the ifconfig command doesn't show one of the most important parameters: the network card's operating mode, i.e. its speed and duplex.

So how do we check the speed and duplex of a network interface?


Solution.

ifconfig

The output will show us the name of the network card device.

To see the current speed of a network link in Linux, as well as whether it's operating in full-duplex mode or not, we'll need the ethtool utility. It may not be installed out of the box (yes, that's just how it is), so we'll need to install it.

For Debian/Ubuntu:

$ sudo apt-get install ethtool


For CentOS/RedHat:

$ sudo yum install ethtool


After that, we run it specifying which network card's current speed we're interested in, and look at the output:

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes


In the second part of the output we see the following lines:

Speed: 1000Mb/s
Duplex: Full


This is exactly what we were looking for — the current network connection speed and its duplex mode.

How to Check Network Card Speed and Duplex Mode in Linux

VIEWING INTERFACE STATISTICS

If you want to get statistics about your network card, enter the command:

sudo ethtool -S device_name

See also

  • [[b6537]]

See also

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system