|Home||Switchboard||Unix Administration||Red Hat||TCP/IP Networks||Neoliberalism||Toxic Managers|
May the source be with you, but remember the KISS principle ;-)
Skepticism and critical thinking is not panacea, but can help to understand the world better
|News||See Also||Recommended Links||Reference||Humor||Etc|
ethtool works with almost all NICs and permit checking and setting NIC parameters such as speed and dull-duplex, half-duplem mode. It also can set NIC speed (such as 10/100Mbps, 100/1000Mbps, or 10/100/1000Mbps NIC) to one fixed and non-negotiable speed.
Generally autonegoation is the best setting and you should avoid replacing it with fixed settings unless nessesay. But in case of backups this is not always the case. Also some network applications, such as ftp, might fails to work properly if NIC auto-negotiate speed with switch/router.
For example to check if interface eth0 is full duplex or half-duplex mode and see other parameters try:
# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: g Wake-on: g Link detected: yesHere full duplex, half duplex and auto-negotiation have the following meanings.
Note: If you want to find what type of network card is used, its speed, on which IRQ it is listed, and the chip type used, you use the following command : # dmesg |grep eth0
To set specific parameters usually option -s is used:
Red Hat directory/file: /etc/sysconfig/network-scripts/ifcfg-eth0:
Suse directory/file: /etc/sysconfig/network (suse defines interfaces via MAC)
Dec 22, 2016 | Ask Xmodulo
The second method is to use the ethtool command. To find out the driver name for an interface eth0, run the following.
$ ethtool -i eth0
1.49.1. RHBA-2010:0279: bug fix and enhancement updateAn enhanced ethtool package that fixes a number of minor issues is now available.
The ethtool utility allows the querying and changing of specific settings on network adapters. These settings include speed, port, link auto-negotiation settings and PCI locations.This updated package adds the following enhancements:
* ethtool can now display all NIC speeds, not just 10/100/1000. (BZ#450162)* the redundant INSTALL file has been removed from the package. (BZ#472034)
* the ethtool usage message has been fixed to not state that -h requires a DEVNAME. (BZ#472038)* ethtool now recognizes 10000 as a valid speed and includes it as a supported link mode. (BZ#524241, BZ#529395)
All ethtool users should upgrade to this updated package which provides these enhancements.
For logging on to the net or for attaching as a node on a LAN, your computer needs a network card. The network card forms the interface between your computer and the network. There are different kinds of network cards available in the market depending on its speed and other features. Here is a tip to find out the characteristics of your network card.
If you want to find what type of network card is used, its speed, on which IRQ it is listed, and the chip type used, you use the following command :# dmesg |grep eth0Here eth0 is the first network card. If you have additional cards, it will be named eth1, eth2 and so on. And here is the output of the above command :divert: allocating divert_blk for eth0 eth0: RealTek RTL8139 at 0xd800, 00:80:48:34:c2:84, IRQ 9 eth0: Identified 8139 chip type 'RTL-8100B/8139D' divert: freeing divert_blk for eth0 divert: allocating divert_blk for eth0 eth0: RealTek RTL8139 at 0xd800, 00:90:44:34:a5:33, IRQ 9 eth0: Identified 8139 chip type 'RTL-8100B/8139D' eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 eth0: no IPv6 routers present ...The important things to note here are those highlighted in colour. As you can see from the above listing, my ethernet card is a RealTek RTL8139 chipset based card on IRQ 9 (Interrupt Request). Its speed is 100 Mbps and is a full-duplex card. And the link is up.
And it uses autonegotiation to bring up the link. You can call the above device as a 10/100 NIC.
Another tool which also does the same thing is ethtool. Try the following command on your machine to see the output.# 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: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 32 Transceiver: internal Auto-negotiation: on Supports Wake-on: pumbg Wake-on: p Current message level: 0x00000007 (7) Link detected: yesHere full duplex, half duplex and auto-negotiation have the following meanings.
Full Duplex - Logic that enables concurrent sending and receiving. This is usually desirable and enabled when your computer is connected to a switch.
Half Duplex - This logic requires a card to only send or receive at a single point of time. When your machine is connected to a Hub, it auto-negotiates itself and uses half duplex to avoid collisions.
Auto-negotiation - This is the process of deciding whether to work in full duplex mode or half duplex mode. An ethernet card supporting autonegotiation will decide for itself which mode is the optimal one depending on the network it is attached to.
Task: Install mii-tool and ethtool tools
If you are using Debian Linux you can install both of these package with following command:# apt-get install ethtool net-toolsIf you are using Red Hat Enterprise Linux you can install both of these package with following command:# up2date ethtool net-toolsIf you are using Fedora Core Linux you can install both of these package with following command:# yum install ethtool net-tools
Task: Get speed and other information for eth0
Type following command as root user:
# ethtool eth0Output: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: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 32 Transceiver: internal Auto-negotiation: on Supports Wake-on: pumbg Wake-on: d Current message level: 0x00000007 (7) Link detected: yes
Or use mii-tool command as follows:# mii-tool eth0Output:eth0: negotiated 100baseTx-FD flow-control, link ok
Task: Change the speed and duplex settings
Setup eth0 negotiated speed with mii-tool
Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD:# mii-tool -F 100baseTx-HD
# mii-tool -F 10baseT-HDSetup eth0 negotiated speed with ethtool# ethtool -s eth0 speed 100 duplex full
# ethtool -s eth0 speed 10 duplex halfTo make these settings permanent you need to create a shell script and call from /etc/rc.local (Red Hat) or if you are using Debian create a script into the directory /etc/init.d/ directory and run update-rc.d command to update the script.
Read man page of mii-tool and ethtool for more information.
Google matched content
ethtool - Wikipedia, the free encyclopedia
Fun with ethtool | Linux JournalMay 25, 2011By Jayson Broughton
9 Linux ethtool Examples to Manipulate Ethernet Card (NIC Card)
Using Ethtool settings to address network performance issues Citrix Blogs
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info|
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Created May 16, 1996; Last modified: March 12, 2019