MII-TOOL(8)

πŸ“¦
version 2.10 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

okay so bestie, this is mii-tool πŸ¦‹ and it's giving "check your network interface's MII status" energy. It's all about viewing and manipulating the media-independent interface status ✨

πŸ’… SYNOPSIS πŸ’…

mii-tool [-v, --verbose] [-V, --version] [-R, --reset] [-r, --restart]
[-w, --watch] [-l, --log] [-A, --advertise=media,...]  [-F,
--force=media] [-p, --phy=addr] interface ...

πŸ’– DESCRIPTION πŸ’–

okay so this 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, so it's lowkey the thing doing the heavy lifting 🌸

Most intelligent network devices use an autonegotiation protocol to say what media technologies they support, and then pick the fastest one everyone can agree on 🫢 The -A or --advertise options let you tell the MII to only advertise a subset of its capabilities. Some passive devices, like single-speed hubs, can't autonegotiate at all πŸ’€ For those, the MII protocol can still establish a link by just detecting a 10baseT or 100baseT link beat. That's where -F or --force comes in, forcing the MII to run in one mode instead of negotiating ✨ Just know that -A and -F are mutually exclusive, so you can't use both at once, no cap πŸ™…β€β™€οΈ

The default short output reports the negotiated link speed and link status for each interface 🧚

🌈 OPTIONS 🌈

  • -v, --verbose β€” shows more detailed MII status info πŸ” Use it twice and you also get the raw MII register contents πŸ’œ
⚠️ Alert: if you go three times, it'll force a read of all MII registers, including the non-standard ones 😭 There's no guarantee you'll get a valid answer from the PHY, and PHY communication can even hang. With the e1000e driver, reading register 0x07 will fail πŸ’€
  • -V, --version β€” shows the program version info πŸŽ€
  • -R, --reset β€” resets the MII back to its default configuration πŸ”„
  • -r, --restart β€” restarts autonegotiation πŸš€
  • -w, --watch β€” watches the interface(s) and reports link status changes πŸ‘€ The MII interfaces get polled every one second ⏱️
  • -l, --log β€” used together with -w, this records link status changes in the system log instead of printing them to standard output πŸ“œ
  • -F media, --force=media β€” disables autonegotiation and forces the MII into either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD operation πŸ’…
  • -A media,..., --advertise=media,... β€” enables and restarts autonegotiation, but only advertises the media technologies you pick 🫧 Separate multiple technologies with commas. The valid media are 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, and 10baseT-HD πŸ“
  • -p addr, --phy=addr β€” overrides the MII address the kernel gave you with the value addr πŸ§šβ€β™€οΈ

πŸ™ˆ DIAGNOSTICS πŸ™ˆ

when stuff goes wrong, these are the errors you'll see, iykyk 😭

  • SIOCGMIIPHY on 'eth?' failed: Invalid argument β€” if the interface isn't running (up), the kernel will refuse to report its link state πŸ™…β€β™€οΈ
  • SIOCGMIIPHY on 'eth?' failed: Operation not permitted β€” most kernels restrict access to root, so try again as root πŸ‘‘
  • SIOCGMIIPHY on 'eth?' failed: No such device β€” this one pops up when the kernel doesn't know about the named device 🫠
  • SIOCGMIIPHY on 'eth?' failed: Operation not supported β€” the interface in question doesn't support MII queries. Most likely it doesn't have MII transceivers at all, bestie πŸ’”

πŸ¦‹ AUTHORS πŸ¦‹

these are the legends who made it happen 🫢

  • David Hinds - dhinds@pcmcia.sourceforge.org
  • Donald Becker - becker@scyld.com
  • Bernd Eckenfels - net-tools@lina.inka.de

✨ SEE ALSO ✨

if you want to go deeper, check out the homepage of the net-tools project at http://net-tools.sourceforge.net 🌐


πŸ’– and that's the tea, bestie! mii-tool from the net-tools project, dated 2013-02-15 πŸ’…βœ¨