mii-tool

Tools for configuring network device negotiation methods

Supplementary instructions

mii-tool command is used to view and manage the status of the network interface of the media. Sometimes the network card needs to be configured with a negotiation method, such as half-duplex, full-duplex, and auto-negotiation configuration for the 10/100/1000M network card. But most network devices do not require us to modify the negotiation, because most networks use automatic negotiation to solve mutual communication problems when they are set up for access. However, automatic negotiation is not a panacea. Sometimes errors may occur, such as a relatively high packet loss rate. In this case, we need to specify the negotiation method of the network card. mii-tool can specify the negotiation method of the network card. Let’s talk about the usage of mii-tool below.

grammar

usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]

Options

-V displays version information;
-v displays network interface information;
-R resets MII to the on state;
-r restarts auto-negotiation mode;
-w View the status changes of network interface connections;
-l writes events to the system log;
-A commands a specific network interface;
-F changes the network interface negotiation method;

media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
(to advertise both HD and FD) 100baseTx, 10baseT

Example

Check the negotiation status of a network interface:

[root@localhost ~]# mii-tool -v eth0
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:50:ef, model 60 rev 8
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

Note: In the above example, we can see that it is auto-negotiation, pay attention to the red text.

Change the network interface negotiation method:

To change the negotiation method of the network interface, we need to use the -F option, which can be followed by parameters such as 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD;

What should we do if we want to change the network interface eth0 to 1000Mb/s full-duplex mode?

[root@localhost ~]# mii-tool -F 100baseTx-FD
[root@localhost ~]# mii-tool -v eth0
eth0: 100 Mbit, full duplex, link ok
   product info: vendor 00:00:00, model 0 rev 0
   basic mode: 100 Mbit, full duplex
   basic status: link OK
   capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
   advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

Note: Has it been changed? Of course, we can also use the ethtool tool to make changes, such as executing the following command:

[root@localhost ~]# ethtool -s eth0 speed 100 duplex full