MII-DIAG(8)
π MII-DIAG(8) π
okay bestie, so this is mii-diag from the System Manager's Manual section, and it is literally the network adapter control and monitoring icon it thinks it is. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
mii-diag β Network adapter control and monitoring. that's it, that's the whole name. short, sweet, slays π
π SYNOPSIS π
mii-diag [options]<interface>
yes, the interface goes right up against the options with no space, that's just how it is, don't fight it π¦
πΈ DESCRIPTION πΈ
so this manual page documents briefly the mii-diag network adapter control and monitoring command. more documentation? yes queen, it's available from http://scyld.com/diag/index.html β¨
this mii-diag command configures, controls and monitors the transceiver management registers for network interfaces, and also configures driver operational parameters. for the transceiver control part, mii-diag uses the Media Independent Interface (MII) standard β which is, like, the entire reason the command is named that. it also has extra Linux-specific controls so it can communicate parameters such as message enable settings and buffer sizes to the underlying device driver π«
the MII standard defines registers that control and report network transceiver capabilities, link settings and errors. examples bestie? link speed, duplex, capabilities advertised to the link partner, status LED indications and link error counters. the whole vibe check of your NIC, no cap π
π OPTIONS π
the mii-diag command supports both single character and long option names, because it contains multitudes.
- short options use a single dash (
Β΄-Β΄) in front of the option character. - for options without parameters, multiple options may be concatenated after a single dash. (stack 'em, iconic)
- long options are prefixed by two dashes (
Β΄--Β΄), and may be abbreviated with a unique prefix. - a long option may take a parameter of the form
--arg=paramor--arg param.
a summary of options is as follows. and yes, we're listing all of them, don't play π
-A,--advertise <speed|setting>β advertise a speed/setting.-F,--fixed-speed <speed|setting>β fix the speed/setting.
these two share the same description, so here it is: speed is one of:100baseT4,100baseTx,100baseTx-FD,100baseTx-HD,10baseT,10baseT-FD,10baseT-HD. and for more precise control, an explicit numeric register setting is also allowed. fancy fr fr β¨
-a,--all-interfacesβ show the status of all interfaces. this option is not recommended with any other option, especially ones that change settings. like, don't do that bestie, it's giving chaos π-s,--statusβ return exit status2if there is no link beat.-Dβ increase the debugging level. this may be used to understand the actions the command is taking. snooping, but make it productive π-g,--read-parametersβ show driver-specific parameters.-G,--set-parameters value[,value...]β set driver-specific parameters. set an adapter-specific parameters. parameters are comma separated, with missing elements retaining the existing value. so you can be like "only change this one" and it respects that π«Ά-vβ increase the verbosity level. additional-voptions increase the level further. stack them like friendship bracelets π-Vβ show the program version information.-w,--watchβ continuously monitor the transceiver and report changes.-?β emit usage information.
π¦ DESCRIPTION (yes, again, it comes back for round two) π¦
calling the command with just the interface name produces extensive output describing the transceiver capabilities, configuration and current status. so mii-diag eth0, basically, and it spills the tea β
the --monitor option allows scripting link beat changes. (yep, --monitor is a whole separate thing that gets its own little moment here π)
this option is similar to --watch, but with lower overhead and simplified output. it polls the interface only once a second and the output format is a single line per link change with three fixed words:
<unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
example output: mii-diag --monitor eth0
down 0x7809 0x0000
negotiating 0x7829 0x45e1
up 0x782d 0x45e1
down 0x7809 0x0000
this may be used as:
mii-diag --monitor eth0 |
while read linkstatus bmsr linkpar; do
case $linkstatus in
up) ifup eth0 ;;
down) ifdown eth0 ;;
esac
done
it may be useful to shorten the DHCP client daemon timeout if it does not receive an address by adding the following setting to /etc/sysconfig/network:
DHCPCDARGS="-t 3"
that's the glow-up right there β
π SEE ALSO π
ether-wake(8), net-diag(8), mii-tool(8).
addition documentation is available from http://scyld.com/diag/index.html. go read, bestie πβ¨
π KNOWN BUGS π
the --all-interfaces option is quirky. there are very few settings that are usefully applied to all interfaces. so like, it's not evil, it's just... going through something π
π AUTHOR π
the manual pages, diagnostic commands, and many of the underlying Linux network drivers were written by Donald Becker for the Scyld Beowulf(β’) cluster system. king behaviour, honestly π
ok that's the whole page, every single flag and byte of it, no details left behind, periodt π
sending you off with the official deets: Scyld Beowulfβ’ π September 9, 2003 π β and yeah, the footer still says MII-DIAG(8), because some things are simply eternal π¦β¨
π¦ where this page comes from
- centos-stream 10: net-tools 2.0-0.73.20160912git.el10 Β· GPL-2.0-or-later
- centos-stream 9: net-tools 2.0-0.64.20160912git.el9 Β· GPLv2+
- fedora 43: net-tools 2.0-0.74.20160912git.fc43 Β· GPL-2.0-or-later
- fedora 44: net-tools 2.0-0.77.20160912git.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms