Set mii-tool and ethtool in linux Nic mode

Source: Internet
Author: User
Article title: set mii-tool and ethtool in linux Nic mode. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Mii-tool changes the network interface negotiation method;

# Mii-tool -- help

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

-V, -- verbose more verbose output note: Displays network interface information;

-R, -- reset MII to poweron state Note: reset MII to enabled state;

-R, -- restart autonegotiation note: restart the automatic negotiation mode;

-W, -- watch monitor for link status changes note: view the status changes of network interface connections;

-L, -- log with-w, write events to syslog note: write events to system logs;

-A, -- advertise = media,... advertise only specified media Note: indicates A specific network interface;

-F, -- force = media force specified media technology Note: change the network interface negotiation method;

Media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,

(To advertise both HD and FD) 100 baseTx, 10 baseT

* Instance 1: view the network interface negotiation status;

[Root @ localhost ~] # Mii-tool-v eth0

Eth0: negotiated 100baseTx-FD, link OK

Product info: vendor 00:00:00, model 0 rev 0

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

Link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

Note: The above example shows automatic negotiation. Pay attention to the red part;

* Instance 2: Change the network interface negotiation method;

To change the network interface negotiation method, we need to use the-F option, followed by 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD, and other parameters;

What should we do if we want to change the network interface eth0 to 1000 Mbit/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 also use the ethtool to change it, such as executing the following command;

[Root @ localhost ~] # Ethtool-s eth0 speed 100 duplex full

02. Introduction to the network negotiation function of ethtool;

Ethtool-Display or change ethernet card settings (ethtool is used to Display and change the Nic settings). This tool is complex and has many functions. Because foreign languages are difficult to understand. So let's talk about how to set up network device negotiation.

2.1 ethtool displays the network port setting function;

This function is easy to handle. Is ethtool directly connected to the network? Interface. for example, the following example;

[Root @ localhost ~] # Ethtool eth0

Settings for eth0:

Supported ports: [tp mii]

Supported link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Advertised auto-negotiation: No note: Automatic negotiation is disabled.

Speed: 100 Mb/s note: Speed: 100 Mb

Duplex: Full Note: Full Duplex

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: off

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0x00000007 (7)

Link detected: yes note: eth0 has been activated;

2.2 ethtool sets the network card negotiation mode;

In the-h help of ethtool, we can see such help information;

Ethtool-s DEVNAME

[Speed 10 | 100 | 1000]

[Duplex half | full]

[Port tp | aui | bnc | mii | fiber]

[Autoneg on | off]

* Example 1: Change the eth0 speed of the network adapter to 10 Mb/s and adopt half duplex;

[Root @ cuc03 beinan] # ethtool-s eth1 speed 10 duplex half

[Root @ cuc03 beinan] # ethtool eth1

Settings for eth1:

Supported ports: [tp mii]

Supported link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Advertised auto-negotiation: No

Speed: 10 Mb/s note: Speed: 10 M/s

Duplex: Half Note: Half Duplex

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: off

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0x00000007 (7)

Link detected: no note: eth1 is not activated;

* Example 2: Change the eth0 speed of the NIC to 100 Mb/s, and use full duplex;

[Root @ cuc03 beinan] # ethtool-s eth1 speed 100 duplex full

[Root @ cuc03 beinan] # ethtool eth1

Settings for eth1:

Supported ports: [tp mii]

Supported link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Supports auto-negotiation: Yes

Advertised link modes: 10 baseT/Half 10 baseT/Full

100 baseT/Half 100 baseT/Full

Advertised auto-negotiation: No

Speed: 100 Mb/s note: The Speed is 100 Mb/s

Duplex: Full Note: Full Duplex

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: off

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0x00000007 (7)

Link detected: no note: The eth1 Nic is not activated;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.