我要评分
获取效率
正确性
完整性
易理解

ethtool

Introduction

ethtool is a powerful network management tool in Linux. Currently, almost all NIC drivers support ethtool. It can be used to query the NIC status, driver version, data receiving and sending information, capability configuration, NIC working mode, and link speed.

Installation Method

Take CentOS as an example. Run the following command to install the tool:

1
# yum -y install ethtool net-tools

How to Use

Command format: ethtool [parameter]

Common parameters are as follows:

Parameter

Description

ethX

Queries the basic settings of the ethx network port. In the command, x indicates the NIC ID, for example, eth0 and eth1.

-k

Checks the NIC offload information.

-K

Modifies the NIC offload information.

-c

Checks the NIC aggregation information.

-C

Modifies the NIC aggregation information.

-l

Checks the number of NIC queues.

-L

Sets the number of NIC queues.

Output format:

1
# ethtool -k eth0
1
2
3
4
5
Features for eth0: 
rx-checksumming: on 
tx-checksumming: on 
scatter-gather: on 
tcp-segmentation-offload: on
1
# ethtool -l eth0
1
2
3
4
5
6
Channel parameters for eth0: 
Pre-set maximums: 
...
Current hardware settings: 
...
Combined:       8 
1
# ethtool -c eth0
1
2
3
4
5
6
7
8
Coalesce parameters for eth0: 
Adaptive RX: off  TX: off 
...
rx-usecs: 30
rx-frames: 50
...
tx-usecs: 30
tx-frames: 1

The parameters are described as follows:

Parameter

Description

rx-checksumming

Indicates the checksum of received packets.

tx-checksumming

Indicates the checksum of sent packets.

scatter-gather

Indicates the scatter-gather function, a prerequisite for NICs to support TSO.

tcp-segmentation-offload

Uses NICs to fragment TCP packets.

Combined

Indicates the number of NIC queues.

adaptive-rx

Indicates the dynamic aggregation execution switch of the RX queue.

adaptive-tx

Indicates the dynamic aggregation execution switch of the TX queue.

tx-usecs

Indicates the number of microseconds after at least one data packet is transmitted before an interrupt is generated.

tx-frames

Indicates the number of data packets transmitted before an interrupt is generated.

rx-usecs

Indicates the number of microseconds after at least one data packet is received before an interrupt is generated.

rx-frames

Indicates the number of data packets received before an interrupt is generated.