Linux ethtool Tutorial with Usage Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-ethtool-tutorial-usage-examples/
PINTEREST
PINTEREST
INSTAGRAM

ethtool  is useful utility used for Network Interface Card configuration. It provides simple and fast way to get and set configuration about IP address, interface speed, interface duplex or half duplex etc.

List and Printer Interface Properties

We will start with simply listing given network interface properties. We will see that there is a lot of network interface properties which is outputted by ethtool . For this operation we do not need to provide any option. We will just provide the interface name which is ens33 in this case.

List and Printer Interface Properties
List and Printer Interface Properties

We listed following properties of network interface

  • Supported link modes shows supported network speed and duplex modes.
  • Supports auto-negotition shows whether interface supports auto set link mode.
  • Speed shows currently set network interface speed.
  • Duplex shows currently set duplex status
  • Auto-negotiation shows current auto-negotiate mode.

List and Print Network Interface Driver Settings

Network Interfaces are managed and used with drivers. Drivers are operating system level modules which is the same for network interface cards with same chipset. We can list currently used driver of  given network interface card with the -i option and the interface name.

List and Print Network Interface Driver Settings
List and Print Network Interface Driver Settings

List and Print Auto-negotiation of Network Interface Driver

As stated previously auto-negotiation is used to determine link speed of the network interface transmitter. The other end of the link is another factor for link speed. We can enable auto-negotiation for talk the link speed with the remote host and set the best speed for the link. We can print current auto-negotiation setting with the -a and network interface name.

LEARN MORE  Linux Network Administration with ping and ip Commands

List and Print Auto-negotiation of Network Interface Driver
List and Print Auto-negotiation of Network Interface Driver

Display Statistics of The Network Interface

Network statistics provides useful information about network utilization of the system. Statistics provides information like rx_packets, tx_packets,rx_bytes,tx_bytes etc. We can list network interfaces statistics with -S option and the interface name.

Display Statistics of The Network Interface
Display Statistics of The Network Interface

Set Auto-Negotiation of Network Interface

We can change auto-negotiation of the given network interface card. We will use -s option with autoneg off parameter to disable or autoneg on to enable. We need root privileges becauase of system level chages.

OR

Set Speed of Network Interface

We can change the speed of the network interface card. This can be useful if remote interface do not supports auto-negotiation or there are link speed related problems. We will use -s option with speed 100 to set speed to 100Mbps. Also disabling auto-negotiation is good practice.

Blink Specified Network Interface Led

As we know network interface cards have some leds to give information about traffic and link. We can blink these leds by using ethtool. This may be useful if we need to blink leds to specify network interface card. We will use -p for this operation.

Make Changes and Configurations Permanent

After a system reboot all configurations will be reset. But we can make these configuration permanent in order to save configuration time. Just add following lines to the related operation system configuration file.

LEARN MORE  Network Classless Inter Domain Routing (CIDR) Cheat Sheet

Ubuntu, Debian, Mint, Kali

Fedora, CentOS, RHEL

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/linux-ethtool-tutorial-usage-examples/
PINTEREST
PINTEREST
INSTAGRAM