About Linux FAQ

Browse More FAQs:

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

Posted by Vivek Gite [Last updated: November 29, 2007]

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!

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Suresh Yellayi Says:

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

  2. Fachtna Roe Says:

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

  3. S Says:

    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?

  4. vivek Says:

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

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.