Pages

Monday, June 20, 2011

Ethernet card speed and duplex settings

Using ethtool

ethtool is the standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. Among others it can be used to get identification and diagnostic information, extended device statistics , control speed, duplex, autonegotiation and flow control for Ethernet devices
Check the complete syntax of the commands here

To see some information in Ubuntu of your Ethernet adapter
 ~$ lspci | grep -i eth   
 00:0a.0 Ethernet controller: nVidia Corporation MCP77 Ethernet (rev a2)  
 ~$ ethtool -i eth0  
 driver: forcedeth  
 version: 0.64  
 firmware-version:   
 bus-info: 0000:00:0a.0  
How to determine Ethernet connection speed in Ubuntu

 ~$ sudo ethtool eth0  
 Settings for eth0:  
   Supported ports: [ MII ]  
   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 pause frame use: No  
   Advertised auto-negotiation: Yes  
   Link partner advertised link modes: Not reported  
   Link partner advertised pause frame use: No  
   Link partner advertised auto-negotiation: No  
   Speed: 100Mb/s  
   Duplex: Full  
   Port: MII  
   PHYAD: 1  
   Transceiver: external  
   Auto-negotiation: on  
   Supports Wake-on: g  
   Wake-on: d  
   Link detected: yes  

 You can filter the output using grep , to show the needed parameter
 sudo ethtool eth0 | grep -i speed  
   Speed: 100Mb/s  


How to change Ethernet card speed and duplex settings  in Ubuntu
To Turn off Auto-Negotiate feature
 sudo ethtool -s eth0 autoneg off  
To setup your Ethernet network card speed 100 and full duplex
 sudo ethtool -s eth0 speed 100 duplex full  
To setup your Ethernet network card speed 10 and half duplex
 sudo ethtool -s eth0 speed 10 duplex half  

For permanent settings see  this page


Using mii-tool 
Deprecated and replaced by the newer ethtool command,
I have tried with mii-tool but my Ethernet card does not support it

 sudo mii-tool eth0  
 SIOCGMIIPHY on 'eth0' failed: Operation not supported  

No comments: