LinuxCommandLibrary

mii-tool

Check Ethernet media status and settings

SYNOPSIS

mii-tool [options] <interface>

PARAMETERS

-V, --version
    Displays the version number of mii-tool.

-v, --verbose
    Provides more detailed output, showing additional MII register information and capabilities.

-w, --watch
    Continuously monitors the specified interface for link status changes, updating the display every two seconds until interrupted.

-l, --log
    Logs link status changes to the system syslog facility, typically /var/log/messages or similar.

-R, --reset
    Resets the MII to its default power-on state, potentially causing a link renegotiation.

-r, --restart
    Restarts the autonegotiation process on the specified interface, prompting the network card to re-evaluate link parameters with its peer.

-A <modes>, --advertise=<modes>
    Sets the autonegotiation advertisement modes. modes can be a comma-separated list of supported speeds and duplex modes, e.g., 100baseTx-FD,10baseT-HD.

-F <mode>, --force=<mode>
    Forces the interface to a specific link mode, bypassing autonegotiation. Examples: 100baseTx-FD for 100 Mbps full-duplex, or 10baseT-HD for 10 Mbps half-duplex. Use with caution.

-D, --debug
    Shows low-level debug information, often including raw MII register values, useful for troubleshooting.

DESCRIPTION

mii-tool is a command-line utility used to examine and control the Media Independent Interface (MII) of Ethernet network devices. It provides detailed information about the link status of an Ethernet adapter, including whether a physical link is established, the detected speed (e.g., 10 Mbps, 100 Mbps), and the duplex mode (half-duplex or full-duplex).

Beyond querying, mii-tool also offers functionality to modify MII registers, allowing users to force specific link settings like speed and duplex, or to restart the autonegotiation process. This tool is particularly relevant for older 10/100 Mbps Ethernet hardware that relies on the MII standard for physical layer communication and autonegotiation. For modern Gigabit Ethernet and beyond, the more comprehensive and powerful ethtool utility has largely superseded mii-tool.

CAVEATS

mii-tool is largely considered deprecated for modern network adapters (Gigabit Ethernet and higher). Most contemporary Linux distributions and network drivers rely on the ethtool utility for interface configuration and diagnostics, which provides a more comprehensive set of features and supports newer physical layer standards. Forcing link modes with -F can lead to connectivity problems if the connected device is set to autonegotiate; autonegotiation is generally the recommended approach for reliable connections.

MII AND AUTONEGOTIATION

The Media Independent Interface (MII) is a standard interface used to connect an Ethernet MAC (Media Access Controller) to a PHY (Physical Layer) chip. It's crucial for 10/100 Mbps Ethernet to determine link speed and duplex settings. Autonegotiation is a feature of Ethernet over twisted pair that allows connected devices to automatically choose the best common transmission parameters, such as speed, duplex mode, and flow control. While mii-tool can force these settings, autonegotiation is typically preferred to ensure optimal and stable network connections, as misconfiguration can lead to 'duplex mismatch' errors and severe performance degradation.

HISTORY

mii-tool emerged as a specialized utility for managing Ethernet adapters that conformed to the MII standard, which was prevalent for 10 Mbps and 100 Mbps interfaces. Its development was tied to the capabilities exposed by network card drivers through the kernel's MII API. As network technology advanced to Gigabit Ethernet and beyond, new interfaces (like GMII, RGMII) and more complex management requirements arose, leading to the development and widespread adoption of ethtool as the de-facto standard tool for Ethernet device configuration and statistics on Linux. Consequently, mii-tool's usage has declined significantly, and it is now primarily of historical interest or for use with very old hardware where ethtool might not provide equivalent functionality.

SEE ALSO

ethtool(8), ip(8), ifconfig(8)

Copied to clipboard