Sunday 13 April 2014

ethtool : powerful simple tool to display or modify NIC parameters



I recently discovered ethtool which is a simple but effective command line tool for finding out information about your network card or to change the network settings.

Note - ethtool can only be used against physical adapters

Installation & Adapter Information
  •  Install on Linux Mint, Ubuntu or Raspberry Pi:
$ sudo apt-get -y install ethtool
  • Find out your adapters with ifconfig (typically starting eth0)
$ ifconfig

Adapter Information
  • Running ethtool with no options prints out adapter information e.g.
 $ sudo ethtool eth0 
  • Example output


  • The above network card supports
    • MMI (Media Independent Interface)
    • Maximum of 100base T/Full 
    • Auto negotiation support
    • Wake on 'MagicPacket'
  •  Actual device settings
    • Speed 100Mb/s
    • Full Duplex
    • Running MII
    • Physical address : 1
    • Auto Negotiation : enabled
    • Wake On Lan : disabled
    • Link is detected
  •  This information is really useful when troubleshooting a network card

Modify Settings
  •  '-s' can be used to modify settings on a NIC e.g. to set to 1000baseT/Full (if your switch supports it) :
 $ sudo ethtool -s eth0 speed 1000 duplex full autoneg on

 Find a Network Card
  • Occasionally on a server will many multiple cards it can be difficult to know which network card related to the system assigned ethX
  • ethtool has a cool 'blinking' feature that allows you to define the number of binks on a specified network card :
 $ sudo ethtool -p eth0 10
  • The above command will blink eth0 for 10 seconds
Driver Information
  •  The '-i' option queries the network card for driver information on the card
 $ sudo ethtool -i eth0

  • This provides a really easy and quick way to obtain the driver information

Statistics
  •  It can be really useful to obtain network card statistics
  • The '-S' option can be used to obtain the information
 $ sudo ethtool -S eth0








No comments:

Post a Comment