1 command-miI-Tool & ethtool (configure Nic Mode)

Source: Internet
Author: User

MII-tool usage:

 

[Root @ localhost ~] # MiI-tool-help
Usage: MII-tool [-vvrrwl] [-a media,... |-F media] [interface...]
-V,-version display version information
-V,-verbose more verbose output Note: displays network interface information;
-R,-Reset reset MII to poweron state Note: reset MII to Enabled state;
-R,-Restart 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

 

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

This network card works in 100 m full duplex adaptive mode, "basetx-fd" means m full duplex.

 

 

Change Network Interface negotiation method

 

What should I do if I want to change the network interface eth0 to the 10 Mbit/s full duplex mode?

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;

 

Command: # miI-tool-F media [interface]

Command miI-tool-F is to change the mode | option | Nic

 

Media optional modes include 100basetx-fd, 100basetx-hd, 10baset-fd, and 10baset-hd. Interface indicates the selected Nic, such as eth0 and eth1. The default value is eth0.

That is:

# MiI-tool-F 10baset-fd eth0

 

Set the NIC to work in 10 M half duplex mode. Enter the following command:

# MiI-tool-F 10baset-hd eth0

 

To restore the adaptive working mode of the network adapter, run the following command:

# MiI-tool-r eth0

 

Note: You may need administrator permissions in Ubuntu to modify or view the NIC.

If you do not have the permission, the system will prompt:

Siocgmiiphy on 'eth0' failed: operation not permitted You do not have permission to operate

In this case, add sudo miI-tool-V eth0 to check the current Nic status.

 

 

Ethtool usage:

 

 

 

Ethtool displays the network port setting function;

Ethtool is a command used to query and set Nic parameters in Linux.

 

Ethtool ethx // query basic ethx network port settings

Ethtool-H // display the ethtool Command help (HELP)

Ethtool-I ethx // query ethx network port information

Ethtool-D ethx // query the registration information of the ethx network port

Ethtool-r ethx // reset the ethx network port to the Adaptive Mode

Ethtool-s ethx // query the ethx network port receiving and receiving packet statistics

Ethtool-s ethx [speed 10 | 100 | 1000] // sets the network port rate to 10/100/1000 m

[Duplex half | Full] // sets the network port half/Full Duplex

[Autoneg on | off] // sets whether the network port is self-negotiated.

This is the interface directly after ethtool, but Ubuntu requires me to install it, so it is useless, but I also set it

 

[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; ethtool sets the NIC 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]/

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;

 

Change the eth0 speed of the network adapter to 100 Mb/s and adopt 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.