The ethtool can be used to query and change settings such as speed, auto- negotiation and checksum offload on many network devices, especially Ethernet devices. How do I install and use ethtool under Ubuntu or Debian Linux based system running on my IBM server?

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Debian or Ubuntu Linux
Est. reading time 3 minutes
To control and see the settings of wired Ethernet devices you need to use the ethtool command. It can be used to:
  1. Get identification and diagnostic information
  2. Get extended device statistics
  3. Control speed, duplex, autonegotiation and flow control for Ethernet devices
  4. Control checksum offload and other hardware offload features
  5. Control DMA ring sizes and interrupt moderation
  6. Control receive queue selection for multiqueue devices
  7. Upgrade firmware in flash memory and much more

Let us see how to install ethtool to query or control network driver and hardware settings on Debian or Ubuntu Linux.

Ubuntu / Debian Linux Install ethtool command

Type the following apt-get command or apt command to install ethtool utility under Debian or Ubuntu Linux:
$ sudo apt-get update
$ sudo apt-get install ethtool

OR
# apt-get update
# apt-get install ethtool

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ethtool
0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded.
Need to get 134 kB of archives.
After this operation, 461 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 ethtool amd64 1:5.4-1 [134 kB]
Fetched 134 kB in 1s (102 kB/s)   
Selecting previously unselected package ethtool.
(Reading database ... 345028 files and directories currently installed.)
Preparing to unpack .../ethtool_1%3a5.4-1_amd64.deb ...
Unpacking ethtool (1:5.4-1) ...
Setting up ethtool (1:5.4-1) ...
Processing triggers for man-db (2.9.1-1) ...

Syntax

The syntax is as follows for ethtool command:

ethtool deviceName
ethtool [options] deviceName
ethtool eth0

Examples

To see standard information about device eth0, enter:
# ethtool eth0
Here is what I see for my eth0 on Debian or Ubuntu Linux box:

Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: d
	Current message level: 0x00000001 (1)
			       drv
	Link detected: yes

Find out driver name associated driver information for eth0

# ethtool -i eth0
Linux hardware driver (modules) details:

driver: via-rhine
version: 1.5.0
firmware-version: 
bus-info: 0000:00:06.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

Find out statistics for NIC and driver

# ethtool -S eth1
# ethtool --statistics eth0

NIC statistics:
     rx_packets: 108048475
     tx_packets: 125002612
     rx_bytes: 17446338197
     tx_bytes: 113281003056
     rx_broadcast: 83067
     tx_broadcast: 1329
     rx_multicast: 3
     tx_multicast: 9
     rx_errors: 0
     tx_errors: 0
     tx_dropped: 0
     multicast: 3
     collisions: 0
     rx_length_errors: 0
     rx_over_errors: 0
     rx_crc_errors: 0
     rx_frame_errors: 0
     rx_no_buffer_count: 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
     tx_abort_late_coll: 0
     tx_deferred_ok: 0
     tx_single_coll_ok: 0
     tx_multi_coll_ok: 0
     tx_timeout_count: 0
     tx_restart_queue: 2367
     rx_long_length_errors: 0
     rx_short_length_errors: 0
     rx_align_errors: 0
     tx_tcp_seg_good: 0
     tx_tcp_seg_failed: 0
     rx_flow_control_xon: 0
     rx_flow_control_xoff: 0
     tx_flow_control_xon: 0
     tx_flow_control_xoff: 0
     rx_long_byte_count: 17446338197
     rx_csum_offload_good: 107876452
     rx_csum_offload_errors: 2386
     rx_header_split: 0
     alloc_rx_buff_failed: 0
     tx_smbus: 0
     rx_smbus: 0
     dropped_smbus: 0
     rx_dma_failed: 0
     tx_dma_failed: 0

Setup eth0 negotiated speed

The syntax is as follows:
# ethtool -s eth0 speed 100 duplex full
# ethtool --change eth0 speed 10 duplex half
# ethtool eth0
# ethtool eth0 | egrep -i 'speed|duplex'

Here is what I see:

	Speed: 10Mb/s
	Duplex: Half

Conclusion

See the ethtool command man page for more information:
$ man ethtool


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 2 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • Jalal Hajigholamali Jan 5, 2013 @ 6:05

    Hi,

    Very nice article
    Thanks…

  • Meow Jan 8, 2013 @ 14:44

    nice.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum