1MII-DIAG(8) System Manager's Manual MII-DIAG(8)
2
3
4
6 mii-diag - Network adapter control and monitoring
7
9 mii-diag [options]<interface>
10
12 This manual page documents briefly the mii-diag network adapter control
13 and monitoring command. Addition documentation is available from
14 http://scyld.com/diag/index.html.
15
16
17 This mii-diag command configures, controls and monitors the transceiver
18 management registers for network interfaces, and configures driver
19 operational parameters. For transceiver control mii-diag uses the
20 Media Independent Interface (MII) standard (thus the command name). It
21 also has additional Linux-specific controls to communicate parameters
22 such as message enable settings and buffer sizes to the underlying
23 device driver.
24
25 The MII standard defines registers that control and report network
26 transceiver capabilities, link settings and errors. Examples are link
27 speed, duplex, capabilities advertised to the link partner, status LED
28 indications and link error counters.
29
30
32 The mii-diag command supports both single character and long option
33 names. Short options use a single dash (´-´) in front of the option
34 character. For options without parameters, multiple options may be
35 concatenated after a single dash. Long options are prefixed by two
36 dashes (´--´), and may be abbreviated with a unique prefix. A long
37 option may take a parameter of the form --arg=param or --arg param.
38
39
40 A summary of options is as follows.
41
42
43 -A, --advertise <speed|setting>
44 -F, --fixed-speed <speed|setting>
45
46 Speed is one of: 100baseT4, 100baseTx, 100baseTx-FD, 100baseTx-
47 HD, 10baseT, 10baseT-FD, 10baseT-HD. For more precise control
48 an explicit numeric register setting is also allowed.
49
50
51
52 -a, --all-interfaces
53 Show the status of all interfaces. This option is not recom‐
54 mended with any other option, especially ones that change set‐
55 tings.
56
57
58 -s,--status
59 Return exit status 2 if there is no link beat.
60
61
62 -D Increase the debugging level. This may be used to understand
63 the actions the command is taking.
64
65
66 -g, --read-parameters
67 Show driver-specific parameters.
68
69
70 -G, --set-parameters value[,value...]
71 Set driver-specific parameters. Set a adapter-specific parame‐
72 ters. Parameters are comma separated, with missing elements
73 retaining the existing value.
74
75
76 -v Increase the verbosity level. Additional "-v" options increase
77 the level further.
78
79
80 -V Show the program version information.
81
82
83 -w, --watch
84 Continuously monitor the transceiver and report changes.
85
86
87 -? Emit usage information.
88
89
91 Calling the command with just the interface name produces extensive
92 output describing the transceiver capabilities, configuration and cur‐
93 rent status.
94
95
96 The '--monitor' option allows scripting link beat changes.
97
98 This option is similar to --watch, but with lower overhead and simpli‐
99 fied output. It polls the interface only once a second and the output
100 format is a single line per link change with three fixed words
101 <unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
102
103 Example output: mii-diag --monitor eth0
104 down 0x7809 0x0000
105 negotiating 0x7829 0x45e1
106 up 0x782d 0x45e1
107 down 0x7809 0x0000
108
109
110 This may be used as
111 mii-diag --monitor eth0 |
112 while read linkstatus bmsr linkpar; do
113 case $linkstatus in
114 up) ifup eth0 ;;
115 down) ifdown eth0 ;;
116 esac
117 done
118
119
120 It may be useful to shorten the DHCP client daemon timeout if it does
121 not receive an address by adding the following setting to /etc/syscon‐
122 fig/network: DHCPCDARGS="-t 3"
123
124
126 ether-wake(8),net-diag(8),mii-tool(8).
127 Addition documentation is available from
128 http://scyld.com/diag/index.html.
129
130
132 The --all-interfaces option is quirky. There are very few settings
133 that are usefully applied to all interfaces.
134
135
137 The manual pages, diagnostic commands, and many of the underlying Linux
138 network drivers were written by Donald Becker for the Scyld Beowulf(™)
139 cluster system.
140
141
142
143
144Scyld Beowulf™ September 9, 2003 MII-DIAG(8)