≡ Menu

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

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!

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 13 comments… add one }

  • Suresh Yellayi September 22, 2006, 8:57 am

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

  • Fachtna Roe July 17, 2007, 6:06 pm

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

  • S October 25, 2007, 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?

  • nixCraft October 26, 2007, 6:37 am

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

  • Bill Cunningham November 16, 2008, 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.

  • reece February 9, 2009, 4:18 am

    thanks a lot!

  • me May 15, 2009, 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 ?

  • satyender kumar February 16, 2012, 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 !!!

  • wld April 9, 2012, 1:19 pm

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

  • Nehemoth April 2, 2013, 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

  • Sanjay K June 26, 2013, 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

  • Brian July 9, 2013, 6:05 pm

    Finally, the information I was looking for! Thank you

  • Graham May 28, 2015, 5:36 pm

    a couple of things to note
    mii-tool needs to be run as sudo. If not it does not have sufficient permissions to read the ports.
    it has the advantage that it lists all the ethernet interfaces when you have more than 1!

    ethtool needs to have the correct ethernet interface passed to it – you can use ifconfig to see which interfaces are active.

    dmesg does not always report all the interfaces. In my setup where i have two NIC cards with two independent networks dmesg only reports the first (eth0) interface. The other two tools can be used to find teh status of my second (eth3) interface – so be careful with dmesg – it may not be reporting the interface you expect!

Leave a Comment