Detailed explanation of ethtool commands in CentOS

Source: Internet
Author: User

Detailed explanation of ethtool commands in CentOS
Ethtool is a command used to query and SET network interface card parameters.

Usage Overview:
Ethtool ethx // query the Basic settings of the ethx network port. x indicates the ID of the corresponding Nic, such as eth0 and eth1.
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] [duplex half | full] [autoneg on | off] // sets the network port rate to 10/100/1000 M, and sets the network port half/full duplex set whether the network port is self-negotiated

Example:
1) [root @ linux/] # ethtool eth1
Settings for eth1:
Supported ports: [TP]
Supported link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
1000 baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10 baseT/Half 10 baseT/Full
100 baseT/Half 100 baseT/Full
1000 baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000 Mb/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/
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_1_o_errors: 0
Rx_missed_errors: 0
Tx_aborted_errors: 0
Tx_carrier_errors: 0
Tx_1_o_errors: 0
Tx_heartbeat_errors: 0
Tx_window_errors: 0
4) [root @ linux/] # ethtool-s eth1 autoneg off speed 100 duplex full

References:
1) [root @ linux/] # which ethtool // query the path where ethtool is stored
/Sbin/ethtool
2) [root @ linux/] # rpm-qf/sbin/ethtool // query ethtool version information
Ethtool-1.6-5
3) How to permanently save ethtool settings on network devices
Solution 1:
The ethtool settings can be saved in the/etc/sysconfig/network-scripts/ifcfg-ethX file to activate the options when the device starts next time.
Example: ethtool-s eth0 speed 100 duplex full autoneg off
This command sets the eth0 device to full-duplex adaptive with a speed of MBS. To set these parameters when eth0 is started, modify the file/etc/sysconfig/network-scripts/ifcfg-eth0 and add the following line:
ETHTOOL_OPTS = "speed 100 duplex full autoneg off"
Solution 2:
Write ethtool settings to/etc/rc. d/rc. local.


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.