Ethtool is a command for querying and setting network card parameters.
Profile:
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 eth1:
Supported ports: [TP]
Supported Link Modes:10baset/half 10baset/full
100baset/half 100baset/full
1000baset/full
Supports Auto-negotiation:yes
Advertised Link Modes:10baset/half 10baset/full
100baset/half 100baset/full
1000baset/full
Advertised Auto-negotiation:yes
speed:1000mb/s
Duplex:full
Port:twisted Pair
phyad:0
Transceiver:internal
Auto-negotiation:on
Supports WAKE-ON:UMBG
Wake-on:d
Link Detected:yes
2) [[email protected]/]# ethtool-i eth1
driver:e1000
Version:5.0.43-k1
firmware-version:n/a
bus-info:06:08.1
3) [[email protected]/]# ethtool-s eth1
NIC Statistics:
rx_packets:58068300
tx_packets:87124083
rx_bytes:1589713008
tx_bytes:2165825901
rx_errors:0
tx_errors:0
rx_dropped:0
tx_dropped:0
multicast:0
collisions:0
rx_length_errors:0
rx_over_errors:0
rx_crc_errors:0
rx_frame_errors:0
rx_fifo_errors:0
rx_missed_errors:0
tx_aborted_errors:0
tx_carrier_errors:0
tx_fifo_errors:0
tx_heartbeat_errors:0
tx_window_errors: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.
This article is from the "I Learn my use" blog, please be sure to keep this source http://593095349.blog.51cto.com/8497121/1603746
Linux network card (set Gigabit NIC speed and mode)