Ethtool utility is used to view and change the ethernet device parameters.
Ethtool is used to query and control network device driver and hardware settings, particularly for wired Ethernet devices. Devname is the name of the network device on which ethtool should operate. OPTIONS top ethtool with a single argument specifying the device name prints current settings of the specified device. To Change Ethernet Adapter Settings. The “ ethtool –s ” command could define the values for “ speed “, “ duplex “, and “ autoneg “. Syntax is: # ethtool –s devicename speed 10/100/1000 duplex half/full autoneg on/off For example, to set the speed at 1000Mb/s, the duplex mode to ‘full’ and the auto-negotiation to ‘on’ the command would be: # ethtool –s enp0s3 speed 1000.
1. List Ethernet Device Properties
- My primary tools for reading OSX details on hardware are systemprofiler and ioreg. For network interface details, ifconfig is the best bet. The first two will show you connection paths for the hardware as well as software driver information. In your example - media and status provide most of the details you listed.
- Enable WOL in the operating system. When the OS shuts down, it sends signals that turn off all the hardware. The operating system is responsible for keeping network adapter powered on, so it may receive Magic Packet and power the system up. This section will describe how to enable this in Windows, Mac OS X and Linux.
- Parent Directory - ModemManager-1.10.8-2.el8.x8664.rpm: 2020-04-26 18:38: 923K: ModemManager-glib-1.10.8-2.el8.i686.rpm: 2020-04-26 18:38: 269K: ModemManager.
When you execute ethtool command with a device name, it displays the following information about the ethernet device.
This above ethtool output displays ethernet card properties such as speed, wake on, duplex and the link detection status. Following are the three types of duplexes available.
- Full duplex : Enables sending and receiving of packets at the same time. This mode is used when the ethernet device is connected to a switch.
- Half duplex : Enables either sending or receiving of packets at a single point of time. This mode is used when the ethernet device is connected to a hub.
- Auto-negotiation : If enabled, the ethernet device itself decides whether to use either full duplex or half duplex based on the network the ethernet device attached to.
2. Change NIC Parameter Using ethtool Option -s autoneg
The above ethtool eth0 output displays that the “Auto-negotiation” parameter is in enabled state. You can disable this using autoneg option in the ethtool as shown below.
After the above change, you could see that the “link detection” value changed to down and auto-negotiation is in off state.
3. Change the Speed of Ethernet Device
Using ethtool you can change the speed of the ethernet device to work with the certain network devices, and the newly assign speed value should be within the limited capacity.
Once you change the speed when the adapter is online, it automatically goes offline, and you need to bring it back online using ifup command.
As shown in the above output, the speed changed from 1000Mb/s to 100Mb/s and auto-negotiation parameter is unset.
To change the Maximum Transmission Unit (MTU), refer to our ifconfig examples article.
4. Display Ethernet Driver Settings
Os X 10.11.4
ethtool -i option displays driver version, firmware version and bus details as shown below.
5. Display Auto-negotiation, RX and TX of eth0
View the autonegotiation details about the specific ethernet device as shown below.
6. Display Network Statistics of Specific Ethernet Device
Use ethtool -S option to display the bytes transfered, received, errors, etc, as shown below.
7. Troubleshoot the Ethernet Connection Issues
When there is a problem with the network connection, you might want to check (or change) the ethernet device parameters explained in the above examples, when you see following issues in the output of ethtool command.
- Speed and Duplex value is shown as Unknown
- Link detection value is shown as No
Upon successful connection, the three parameters mentioned above gets appropriate values. i.e Speed is assigned with known value, Duplex become either Full/Half, and the Link detection becomes Yes.
After the above changes, if the Link Detection still says “No”, check whether there are any issues in the cables that runs from the switch and the system, you might want to dig into that aspect further.
To capture and analyze packets from a specific network interface, use tcpdump utility.
8. Identify Specific Device From Multiple Devices (Blink LED Port of NIC Card)
Let us assume that you have a machine with four ethernet adapters, and you want to identify the physical port of a particular ethernet card. (For example, eth0).
Ethtool For Os X Update
Use ethtool option -p, which will make the corresponding LED of physical port to blink.
9. Make Changes Permanent After Reboot
If you’ve changed any ethernet device parameters using the ethtool, it will all disappear after the next reboot, unless you do the following.
On ubuntu, you have to modify /etc/network/interfaces file and add all your changes as shown below.
The above line should be the last line of the file. This will change speed, duplex and autoneg of eth2 device permanently.
On SUSE, modify the /etc/sysconfig/network/ifcfg-eth-id file and include a new script using POST_UP_SCRIPT variable as shown below. Include the below line as the last line in the corresponding eth1 adpater config file.
Then, create a new file scripts/eth1 as shown below under /etc/sysconfig/network directory. Make sure that the script has execute permission and ensure that the ethtool utility is present under /sbin directory.