Ethtool

Last updated
ethtool
Original author(s) David S. Miller
Developer(s) Ben Hutchings
Initial release1998;26 years ago (1998)
Stable release
6.9 [1]   OOjs UI icon edit-ltr-progressive.svg / 23 May 2024;55 days ago (23 May 2024)
Repository
Written in C
Operating system Linux
Type Networking
License GPLv2
Website www.kernel.org/pub/software/network/ethtool/

ethtool is the primary means in Linux kernel-based operating systems (primarily Linux and Android) for displaying and modifying the parameters of network interface controllers (NICs) and their associated device driver software from application programs running in userspace.

Contents

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

Most Linux distributions provide a standard utility program called ethtool that can be used from a shell to control, or gather information from NICs using the ethtool userspace API. In the Information technology community, the term ethtool is usually used to refer to this utility program.

The ethtool userspace API can be accessed from programs written in the C and C++ programming languages through the C standard library or C++ standard library respectively.

Several scripting languages such as Perl and Python provide ethtool API bindings that allow programmers using these languages to write scripts that can control NIC's.

The macOS and 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:

Examples

To display the current parameters of the first network port (eth0):

$ ethtooleth0 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

[2]

To configure it with the 1000 Mb/s speed and duplex, in 1000BASE-T:

$ ethtool-seth0speed1000duplexfullautonegoff 

To let the link light of the device eth0 flash for two minutes:

$ ethtool-peth0120

To print the driver info of the interface eth0:

$ ethtool-ieth0 driver: mlx5_coreversion: 4.9-2.2.4firmware-version: 14.28.2006 (MT_2420110034)expansion-rom-version: bus-info: 0000:65:00.1supports-statistics: yessupports-test: yessupports-eeprom-access: nosupports-register-dump: nosupports-priv-flags: yes

mii-tool

mii-tool is an older program performing a similar function to ethtool. Since 2003, [3] it's considered obsolete and replaced by ethtool.

Example

To display the current parameters:

$ mii-tool eth0: no autonegotiation, 100baseTx-HD, link ok

To force the network speed to 1 Gbit/s, and the duplex in full on the port 1 (eth0):

$ mii-tool-F1000baseTx-FDeth0 $ mii-tool eth0: 1 000 Mbit, full duplex, link ok

See also

Related Research Articles

<span class="mw-page-title-main">Ethernet over twisted pair</span> Ethernet physical layers using twisted-pair cables

Ethernet over twisted-pair technologies use twisted-pair cables for the physical layer of an Ethernet computer network. They are a subset of all Ethernet physical layers.

<span class="mw-page-title-main">Fast Ethernet</span> Ethernet standards that carry data at the nominal rate of 100 Mbit/s

In computer networking, Fast Ethernet physical layers carry traffic at the nominal rate of 100 Mbit/s. The prior Ethernet speed was 10 Mbit/s. Of the Fast Ethernet physical layers, 100BASE-TX is by far the most common.

<span class="mw-page-title-main">Gigabit Ethernet</span> Standard for Ethernet networking at a data rate of 1 gigabit per second

In computer networking, Gigabit Ethernet is the term applied to transmitting Ethernet frames at a rate of a gigabit per second. The most popular variant, 1000BASE-T, is defined by the IEEE 802.3ab standard. It came into use in 1999, and has replaced Fast Ethernet in wired local networks due to its considerable speed improvement over Fast Ethernet, as well as its use of cables and equipment that are widely available, economical, and similar to previous standards. The first standard for faster 10 Gigabit Ethernet was approved in 2002.

In the seven-layer OSI model of computer networking, the physical layer or layer 1 is the first and lowest layer: the layer most closely associated with the physical connection between devices. The physical layer provides an electrical, mechanical, and procedural interface to the transmission medium. The shapes and properties of the electrical connectors, the frequencies to transmit on, the line code to use and similar low-level parameters, are specified by the physical layer.

<span class="mw-page-title-main">Advanced Linux Sound Architecture</span> Software framework

Advanced Linux Sound Architecture (ALSA) is a software framework and part of the Linux kernel that provides an application programming interface (API) for sound card device drivers.

<span class="mw-page-title-main">Network interface controller</span> Hardware component that connects a computer to a network

A network interface controller is a computer hardware component that connects a computer to a computer network.

TCP offload engine (TOE) is a technology used in some network interface cards (NIC) to offload processing of the entire TCP/IP stack to the network controller. It is primarily used with high-speed network interfaces, such as gigabit Ethernet and 10 Gigabit Ethernet, where processing overhead of the network stack becomes significant. TOEs are often used as a way to reduce the overhead associated with Internet Protocol (IP) storage protocols such as iSCSI and Network File System (NFS).

ifconfig Network administration utility

ifconfig is a system administration utility in Unix-like operating systems for network interface configuration.

udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

The media-independent interface (MII) was originally defined as a standard interface to connect a Fast Ethernet medium access control (MAC) block to a PHY chip. The MII is standardized by IEEE 802.3u and connects different types of PHYs to MACs. Being media independent means that different types of PHY devices for connecting to different media can be used without redesigning or replacing the MAC hardware. Thus any MAC may be used with any PHY, independent of the network signal transmission medium.

<span class="mw-page-title-main">Link aggregation</span> Using multiple network connections in parallel to increase capacity and reliability

In computer networking, link aggregation is the combining of multiple network connections in parallel by any of several methods. Link aggregation increases total throughput beyond what a single connection could sustain, and provides redundancy where all but one of the physical links may fail without losing connectivity. A link aggregation group (LAG) is the combined collection of physical ports.

Autonegotiation is a signaling mechanism and procedure used by Ethernet over twisted pair by which two connected devices choose common transmission parameters, such as speed, duplex mode, and flow control. In this process, the connected devices first share their capabilities regarding these parameters and then choose the highest performance transmission mode they both support.

<span class="mw-page-title-main">Medium-dependent interface</span> Interface between a network device and the data link it communicates over

A medium-dependent interface (MDI) describes the interface in a computer network from a physical-layer implementation to the physical medium used to carry the transmission. Ethernet over twisted pair also defines a medium-dependent interface – crossover (MDI-X) interface. Auto–MDI-X ports on newer network interfaces detect if the connection would require a crossover and automatically choose the MDI or MDI-X configuration to complement the other end of the link.

In computing, ioctl is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are often device-specific. For instance, a CD-ROM device driver which can instruct a physical device to eject a disc would provide an ioctl request code to do so. Device-independent request codes are sometimes used to give userspace access to kernel functions which are only used by core system software or still under development.

An Ethernet crossover cable is a crossover cable for Ethernet used to connect computing devices together directly. It is most often used to connect two devices of the same type, e.g. two computers or two switches to each other. By contrast, straight through patch cables are used to connect devices of different types, such as a computer to a network switch.

<span class="mw-page-title-main">Ethernet physical layer</span> Electrical or optical properties between network devices

The physical-layer specifications of the Ethernet family of computer network standards are published by the Institute of Electrical and Electronics Engineers (IEEE), which defines the electrical or optical properties and the transfer speed of the physical connection between a device and the network or between network devices. It is complemented by the MAC layer and the logical link layer. An implementation of a specific physical layer is commonly referred to as PHY.

iproute2 Suite of computer networking utilities

iproute2 is a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel, including routing, network interfaces, tunnels, traffic control, and network-related device drivers.

<span class="mw-page-title-main">Network block device</span> Network storage protocol

On Linux, network block device (NBD) is a network protocol that can be used to forward a block device from one machine to a second machine. As an example, a local machine can access a hard disk drive that is attached to another computer.

<span class="mw-page-title-main">OPEN Alliance SIG</span>

The OPEN Alliance is a non-profit, special interest group (SIG) of mainly automotive industry and technology providers collaborating to encourage wide scale adoption of Ethernet-based communication as the standard in automotive networking applications.

Classic Ethernet is a family of 10 Mbit/s Ethernet standards, which is the first generation of Ethernet standards. In 10BASE-X, the 10 represents its maximum throughput of 10 Mbit/s, BASE indicates its use of baseband transmission, and X indicates the type of medium used. Classic Ethernet includes coax, twisted pair and optical variants. The first Ethernet standard was published in 1983 and classic Ethernet operating at 10 Mbit/s was the dominant form of Ethernet until the first standard for Fast Ethernet was approved in 1995.

References

  1. "ethtool - utility for controlling network drivers and hardware" . Retrieved 17 July 2024.
  2. "9 Linux ethtool Examples to Manipulate Ethernet Card (NIC Card)". www.thegeekstuff.com. 2010-10-28. Retrieved 2020-11-14.
  3. "Ethernet Auto-negotiation and Duplexing on Linux". lists.olug.org. September 2003.