Go Ethtool usage of Linux commands

Source: Internet
Author: User

Ethtool usage of Linux commands

Original: http://www.linuxidc.com/Linux/2012-01/52669.htm

the Ethtool of Linux/unix command
Description:
Ethtool is a command for querying and setting network card parameters.
Overview:
Ethtool EthX//Query EthX network Port basic settings
ETHTOOL–H//Show command Help for Ethtool
Ethtool–i EthX//query EthX information about the network port
Ethtool–d EthX//Query EthX network Port registration information
Ethtool–r EthX//Reset EthX mesh to Adaptive mode
Ethtool–s EthX//Query EthX network Port receipt Package statistics
Ethtool–s EthX [Speed 10|100|1000]\//Set network port rate 10/100/1000m
[Duplex half|full]\//Set network port half/full Duplex
[Autoneg on|off]\//Set the network port for self-negotiation
[Port tp|aui|bnc|mii]\//Set network Port type
[Phyad n]\
[Xcvr internal|exteral]\
[Wol p|u|m|b|a|g|s|d ...] \
[Sopass xx:yy:zz:aa:bb:cc]\
[Msglvl N]
Example:
1) [[email protected]/]# ethtool eth1

Settings for eth0:supported ports: [TP]supported link modes:10baset/half 10baset/full100baset/half 100baset/full1000baset/fullSupports Auto-negotiation:yesadvertised link modes:10baset/half 10baset/full100baset/half 100baset/full1000baset/fulladvertised Auto-negotiation:yesspeed:1000mb/sDuplex:fullport:twisted Pairphyad:1transceiver:internalAuto-negotiation:onSupports wake-on:gwake-on:dLink Detected:yes

2) [[email protected]/]# ethtool-i eth1

driver:bnx2version:2.0.8-rhfirmware-version:6.2.12 BC 5.2.3 NCSI 2.0.11bus-info:0000:01:00.0

3) [[email protected]/]# ethtool-s eth1
NIC Statistics:

     rx_bytes:216494818     rx_error_bytes:0     tx_bytes:27084170553& nbsp    tx_error_bytes:0     rx_ucast_packets:2933822     rx_mcast_packets:33      rx_bcast_packets:956     tx_ucast_packets:18464909     tx_mcast_ packets:6     tx_bcast_packets:179     tx_mac_errors:0     tx_carrier_ errors:0     rx_crc_errors:0     rx_align_errors:0     tx_single_ collisions:0     tx_multi_collisions:0     tx_deferred:0     tx_excess_ collisions:0     tx_late_collisions:0     tx_total_collisions:0     RX_ fragments:0     rx_jabbers:0     rx_undersize_packets:0     rx_oversize _packets:0     RX_64_BYTE_PACKETS:959&NBSp    rx_65_to_127_byte_packets:2930241     rx_128_to_255_byte_packets:2634     rx_256_to_511_byte_packets:752     rx_512_to_1023_byte_packets:169     rx_1024 _to_1522_byte_packets:56     rx_1523_to_9022_byte_packets:0     tx_64_byte_packets: 183     tx_65_to_127_byte_packets:357     tx_128_to_255_byte_packets:750     tx_256_to_511_byte_packets:224     tx_512_to_1023_byte_packets:991032     TX_ 1024_to_1522_byte_packets:17472548     tx_1523_to_9022_byte_packets:0     rx_xon_ frames:0     rx_xoff_frames:0     tx_xon_frames:0     tx_xoff_frames:0& nbsp    rx_mac_ctrl_frames:0     rx_filtered_packets:0     rx_ftq_discards:0      rx_discards:0     RX_FW_DISCArds:0

4) [[email protected]/]# ethtool-s eth1 Autoneg off speed + duplex full
Related:
1) [[email protected]/]# which Ethtool
/sbin/ethtool
2) [[email protected]/]# rpm-qf/sbin/ethtool
Ethtool-1.6-5
3) How to make Ethtool settings permanently stored in network devices?
Workaround One:
Ethtool settings can be saved through the/etc/sysconfig/network-scripts/ifcfg-ethx file to activate the option the next time the device starts.
Example: ethtool-s eth0 speed of duplex full Autoneg off
This instruction sets the eth0 device to full-duplex adaptive at a speed of 100Mbs. To set these parameters eth0 startup, modify the file/etc/sysconfig/network-scripts/ifcfg-eth0, adding the following line:
Ethtool_opts= "Speed of duplex full Autoneg off"
Workaround Two:
Writes the Ethtool settings to the/etc/rc.d/rc.local.
Two
Workaround:
The link speed and full duplex mode must be specified when the Intel Gigabit network adapter is disabled for adaptive. When using Ethtool to disable the NIC Adaptive feature that uses the e1000 NIC driver module, you must specify both link speed and full duplex operation mode. For example:Ethtool-s eth0 Autoneg off

will be more adaptive than adaptive, but only temporarily disabled, if the command does not specify link speed and full-duplex mode of operation, the driver will automatically re-open the adaptive.
In order to use the Ethtool tool to disable the NIC Adaptive feature of the e1000 NIC driver module, use the following steps
1. Enter terminal mode. 2. Execute ethtool-s ethx Autoneg off speed of duplex full as root
Here Ethx is the name of the network card (for example, eth0 or eth1, etc.), this command will turn off the adaptive characteristics of the network card, and force the setting of the network card speed of 1Gb, full dual public mode.
In addition Ethtool than Mii-tool to advanced, Mii-tool only support the PORT:MII network card.

Go Ethtool usage of Linux commands

Related Article

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.