Ethtool is the command used to query and set the network card parameters.
Overview:
Ethtool ethx //Query ETHX network basic settings
ethtool–h //Display ethtool command help
ethtool–i ethx //query Ethx the relevant information
Ethtool–d ethx //Query ETHX network registration Information
Ethtool–r ethx //Reset ETHX Network to adaptive mode
Ethtool–s ethx //Query ETHX network receipt and contract statistics
Ethtool–s ethx [Speed 10|100|1000]/ //Set network port rate 10/100/1000m
[Duplex half|full]/ // Set the network port half/Full-duplex
[Autoneg on|off]/ //Set the network port is self negotiated
[Port tp|aui|bnc|mii]/ //Set the network port type
[Phyad n]/              &NBSP
[XCVR internal|exteral] /
[Wol p|u|m|b|a|g|s|d ...] /
[Sopass xx:yy:zz:aa:bb:cc]/
[msglvl N]
Example:
1) [Root@linux/]# 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) [Root@linux/]# ethtool-i eth1
driver:e1000
Version:5.0.43-k1
firmware-version:n/a
bus-info:06:08.1
3) [Root@linux/]# 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) [Root@linux/]# ethtool-s eth1 Autoneg off speed-duplex full
Related:
1 [root@linux/]# which ethtool
/sbin/ethtool
2) [Root@linux/]# Rpm-qf/sbin/ethto OL
ethtool-1.6-5
3) How to make the Ethtool settings permanently stored in a network device.
Workaround One:
ethtool settings can be saved by/etc/sysconfig/network-scripts/ifcfg-ethx file. This activates the option the next time the device starts. &NBSP
For example: ethtool-s eth0 speed Duplex full Autoneg off
This instruction sets the eth0 device to Full-duplex Adaptive with a speed of 100Mbs. To set these parameters eth0 startup, modify the file/etc/sysconfig/network-scripts/ifcfg-eth0 and add the following line:
ethtool_opts= Speed 100 Duplex full Autoneg off
Workaround two:
writes the Ethtool setting to the/etc/rc.d/rc.local.