# Ethtool

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Ethtool
> Markdown URL: https://mediated.wiki/source/Ethtool.md
> Source: https://en.wikipedia.org/wiki/Ethtool
> Source revision: 1334667586
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Linux network configuration tool}}
{{Multiple issues|
{{More citations needed|date=November 2020}}
{{One source|date=November 2020}}
}}
{{Lowercase title}}
{{Infobox software
| name = 
| title = ethtool
| logo = 
| screenshot = 
| caption = 
| author = [David S. Miller](/source/David_S._Miller)
| developer = Michal Kubecek
| released = {{start date and age|1998}}
| latest release version = 6.15
| latest release date = {{Start date and age|2025|6|23|df=yes}}
| programming language = [C](/source/C_(programming_language))
| operating system = [Linux](/source/Linux)
| genre = [Networking](/source/Computer_networking)
| license = [GPLv2](/source/GNU_General_Public_License)
| website = {{URL|https://www.kernel.org/pub/software/network/ethtool/}}
}}

'''ethtool''' is the primary means in [Linux kernel](/source/Linux_kernel)-based [operating system](/source/operating_system)s (primarily [Linux](/source/Linux) and [Android](/source/Android_(operating_system))) for displaying and modifying the parameters of [network interface controller](/source/network_interface_controller)s (NICs) and their associated [device driver](/source/device_driver) software from application programs running in [userspace](/source/User_space).

ethtool consists of two components, an [API](/source/API) within the Linux kernel through which NICs can send and receive parameters through their device driver software, and a [userspace](/source/User_space) API based on the Linux SIOCETHTOOL [ioctl](/source/ioctl) mechanism through which application programs can communicate with the kernel to send and receive NIC and NIC driver parameters.

Most [Linux distribution](/source/Linux_distribution)s provide a standard [utility program](/source/utility_program) called [https://man7.org/linux/man-pages/man8/ethtool.8.html ethtool] that can be used from a [shell](/source/shell_(computing)) to control, or gather information from NICs using the ethtool [userspace](/source/User_space) API. In the [Information technology](/source/Information_technology) community, the term ''ethtool'' is usually used to refer to this utility program.

The ethtool [userspace](/source/User_space) API can be accessed from programs written in the [C](/source/C_programming_language) and [C++](/source/C%2B%2B_programming_language) [programming language](/source/programming_language)s through the [C standard library](/source/C_standard_library) or [C++ standard library](/source/C%2B%2B_standard_library) respectively.

Several [scripting language](/source/scripting_language)s such as [Perl](/source/Perl) and [Python](/source/Python_(programming_language)) provide ethtool API [binding](/source/language_binding)s that allow programmers using these languages to write scripts that can control NIC's.

The [macOS](/source/macOS) and [FreeBSD](/source/FreeBSD) operating systems provide utility programs that have a user interface similar to the Linux ethtool utility, but that use fundamentally different APIs to communicate with their operating system kernels and NIC's.

==Usage==
The command is useful for:
* Identification and diagnosis of Ethernet devices
* Extended Ethernet devices statistics
* Control speed, duplex, [autonegotiation](/source/autonegotiation) and [flow control](/source/flow_control_(data)) for Ethernet devices
* Control [checksum](/source/checksum) offload and other hardware offload features, such as [large receive offload](/source/large_receive_offload) and [large send offload](/source/large_send_offload)
* Control [DMA](/source/Direct_memory_access) ring sizes and interrupt moderation
* Control receive queue selection for [multiqueue device](/source/multiqueue_NIC)s
* Upgrade [firmware](/source/firmware) in [flash memory](/source/flash_memory)

== Examples ==
To display the current parameters of the first network port ({{Mono|eth0}}):
<syntaxhighlight lang="console">
$ ethtool eth0
Settings for eth0:
       Supported ports: [ TP MII ]
       Supported link modes: 10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
       Supports auto-negotiation: Yes
       Advertised link modes: 10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
       Advertised auto-negotiation: No
       Speed: 100Mb/s
       Duplex: Full
       Port: MII
       PHYAD: 1
       Transceiver: internal
       Auto-negotiation: off
       Supports Wake-on: g
       Wake-on: g
       Current message level: 0x00000007 (7)
       Link detected: yes
</syntaxhighlight><ref>{{Cite web |date=2010-10-28 |title=9 Linux ethtool Examples to Manipulate Ethernet Card (NIC Card) |url=https://www.thegeekstuff.com/2010/10/ethtool-command/ |access-date=2020-11-14 |website=www.thegeekstuff.com}}</ref>

To configure it with the 1000&nbsp;Mb/s speed and [duplex](/source/Duplex_(telecommunications)), in [1000BASE-T](/source/1000BASE-T):
<syntaxhighlight lang="console">
$ ethtool -s eth0 speed 1000 duplex full autoneg off
</syntaxhighlight>

To let the link light of the device eth0 flash for two minutes:
<syntaxhighlight lang="console">
$ ethtool -p eth0 120
</syntaxhighlight>To print the driver info of the interface eth0:<syntaxhighlight lang="console">
$ ethtool -i eth0
driver: mlx5_core
version: 4.9-2.2.4
firmware-version: 14.28.2006 (MT_2420110034)
expansion-rom-version: 
bus-info: 0000:65:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes
</syntaxhighlight>

==mii-tool==
'''mii-tool''' is an older program performing a similar function to ethtool. Since 2003,<ref>{{cite web|url=http://lists.olug.org/pipermail/olug/2003-September/010415.html|title=Ethernet Auto-negotiation and Duplexing on Linux|website=lists.olug.org|date=September 2003}}</ref> it's considered obsolete and replaced by ethtool.

===Example===
To display the current parameters:
<syntaxhighlight lang="console">
$ mii-tool
eth0: no autonegotiation, 100baseTx-HD, link ok
</syntaxhighlight>
To force the network speed to 1&nbsp;Gbit/s, and the ''duplex'' in ''full'' on the port 1 (eth0):
<syntaxhighlight lang="console">
$ mii-tool -F 1000baseTx-FD eth0
$ mii-tool
eth0: 1 000 Mbit, full duplex, link ok
</syntaxhighlight>

==See also==
{{Portal|Free and open-source software}}
* [iproute2](/source/iproute2)

==References==
{{Reflist}}

==External links==
* {{Official website|https://www.kernel.org/pub/software/network/ethtool/}}
* [http://www.thegeekstuff.com/2010/10/ethtool-command/ Ethtool examples]
* [https://sourceforge.net/projects/net-tools/ Net Tools on sourceforge.net]

{{Unix commands}}

Category:Linux network-related software
Category:Linux configuration utilities
Category:Linux-only free software
Category:Free network-related software

---
Adapted from the Wikipedia article [Ethtool](https://en.wikipedia.org/wiki/Ethtool) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Ethtool?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
