Linux LAN card: Find out full duplex / half speed or mode

by on January 27, 2006 · 12 comments· LAST UPDATED November 29, 2007

in , ,

Q. How do I find out if my Lan (NIC) card working at full or halt duplex mode / speed under Linux?

A. LAN card or NIC is use to send and receive data. Technically, we use word Duplex for this functionality. Full duplex means you are able to send and receive data (files) simultaneously. In half duplex, you can either send or receive data at a time (i.e. you cannot send receive data (files) simultaneously). Obviously, full duplex gives you best user experience. However, how can I find out whether I am using full duplex/half duplex speed/mode?

Task: Find full or half duplex speed

You can use dmesg command to find out your duplex mode:
# dmesg | grep -i duplex
Output:

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

ethtool command

Uss ethtool to display or change ethernet card settings. To display duplex speed, enter:
# ethtool eth1
Output:

Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 10Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: umbg
        Wake-on: g
        Current message level: 0x00000007 (7)
        Link detected: yes

mii-tool command

You can also use mii-tool to find out your duplex mode. Type following command at shell prompt:
# mii-tool

Output:

eth0: negotiated 100baseTx-FD flow-control, link ok

Remember,

  1. 100baseTx-FD: 100Mbps full duplex (FD)
  2. 100baseTx-HD: 100Mbps half duplex (HD)
  3. 10baseT-FD: 10Mbps full duplex (FD)
  4. 10baseT-HD: 10Mbps half duplex (HD)

mii-tool utility checks or sets the status of a network interface’s Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting. If you are using old card then this utility may not work (use dmesg command).

This utility is useful for forcing specific Ethernet speed and duplex settings too, setup 100Mbps full duplex speed under Linux:
# mii-tool -F 100baseTx-FD

Setup 10Mbps half duplex:
# mii-tool -F 10baseT-HD

You can find more information about setting duplex speed here using ethtool command.

Updated for accuracy!

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 12 comments… read them below or add one }

1 Suresh Yellayi September 22, 2006 at 8:57 am

Very informative. Need some Real Time Datacenter , Linux Info..

Reply

2 Fachtna Roe July 17, 2007 at 6:06 pm

Thank you for that information, especially the name of that tool. Very useful. Again, Thanks.

Reply

3 S October 25, 2007 at 10:39 pm

ethtool, mii-tool and dmesg output show very different results

first off mii-tool -v eth0
Output
eth0: negotiated 10baseT-HD, link ok
product info: vendor 00:50:ef, model 21 rev 1
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities:
advertising: 100baseTx-HD 10baseT-HD
link partner: 100baseTx-FD 10baseT-HD

2)
ethtool eth0
Settings for eth0:
Supported ports: [ FIBRE ]
Supported link modes: 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: FIBRE
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Link detected: yes

3) dmesg | grep -i duplex
bnx2: eth0 NIC Link is Up, 1000 Mbps full duplex
bnx2: eth1 NIC Link is Up, 1000 Mbps full duplex

Which one should be believed? mii-tool shows the nic is advertising 100baseT/HD but negotiated 10BaseT/HD (which is really slow for what we want to do); ethtool shows nic is advertising 1000Mb/s FD which, confirms with dmesg output.

Conclusion? mii-tool may not be compatible with the fibre channel nics?

How to interpret this output?

Reply

4 nixCraft October 26, 2007 at 6:37 am

Only use ethtool as mii-tool is not compatible and it will be not included in future version

Reply

5 Bill Cunningham November 16, 2008 at 11:16 pm

I’m the most rabid Linux preacher in the world, but checking link speed and duplex is one area where windoze is easier to work with.

And think Linux is devious? Try it on Solaris.

Reply

6 reece February 9, 2009 at 4:18 am

thanks a lot!

Reply

7 me May 15, 2009 at 9:20 pm

Bill: What is so devious about “dladm show-dev” ?
Also yes windows is easier if you have graphical console but how do you do it on remote logi ?

Reply

8 satyender kumar February 16, 2012 at 7:37 am

my adapter was disconnectig again and again i changed its link speed from 100 mbps full duplex to 10 mbps full duples the problem is gone bu does it affect my downloading speed because i am having a 4 mbps BSNL broadband plan but i am getting the download speed of only 256 kbps
please suggest what to do !!!

Reply

9 wld April 9, 2012 at 1:19 pm

Try to change lan-card, ro wires. Looks like broken card. You can for examle try this with usb-lan.

Reply

10 Nehemoth April 2, 2013 at 2:05 am

In Debian (also Raspberry pi) this is the way to do it as per document
/usr/share/doc/ethtool/README.Debian

iface eth0 inet dhcp
link-speed 100
link-duplex full
ethernet-autoneg off

works like a charm

Reply

11 Sanjay K June 26, 2013 at 12:06 pm

None of the tool is displaying properties of the device.

Only I am getting:

ethtool eth0

Settings for eth0:
Link detected: yes

~Sanjay

Reply

12 Brian July 9, 2013 at 6:05 pm

Finally, the information I was looking for! Thank you

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: