Last updated on December 8, 2020 by Dan Nanni
Sometimes you may want to know the product name or hardware settings of the network interface cards (NICs) attached to your Linux system. For example when you check whether a particular network device driver or a kernel module is compatible with your Ethernet adapter, you need to know its hardware specification such as NIC model/vendor (e.g., Broadcom NetXtreme, Intel I350), speed (e.g., 1GB/s, 10GB/s), link mode (e.g., full/half duplex), etc.
In this tutorial, I will describe how to find Ethernet NIC information from the command line in Linux.
ethtoolThe first method is to use ethtool, a command-line tool for checking or modifying PCI-based Ethernet card settings.
To install ethtool on Ubuntu or Debian:
$ sudo apt-get install ethtool
To install ethtool on Fedora, CentOS or RedHat:
$ sudo yum install ethtool
To display hardware settings of a network interface card with ethtool, run the following command. It is assumed that the NIC card is assigned the name eth0. The reason for sudo access in this case is to allow ethtool to obtain wake-on-LAN settings and link status.
$ sudo 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 pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: g
Link detected: yes
To find Ethernet device driver and firmware information:
$ ethtool -i eth0
driver: bnx2 version: 2.1.6 firmware-version: bc 5.2.3 NCSI 2.0.6 bus-info: 0000:03:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes
To find factory-default MAC address information:
$ ethtool -P eth0
Permanent address: 9c:8e:99:12:2d:8a
lshwThe second method is via lshw, a command-line utility for showing detailed hardware specification of a Linux machine.
To install lshw on Ubuntu or Debian:
$ sudo apt-get install lshw
To install lshw on CentOS or RedHat, first set up Repoforge repository on your system, and then run:
$ sudo yum install lshw
To install lshw on Fedora, simply run:
$ sudo yum install lshw
To show detailed vendor information of your NIC, run the following.
$ sudo lshw -class network
*-network
description: Ethernet interface
product: NetXtreme II BCM5709 Gigabit Ethernet
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: eth0
version: 20
serial: d4:85:64:77:f3:54
size: 1GB/s
capacity: 1GB/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=1.7.5 duplex=full firmware=5.2.3 NCSI 2.0.6 ip=192.168.10.78 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
resources: irq:16 memory:f4000000-f5ffffff memory:e6100000-e610ffff(prefetchable)
lspciIf all you need to know is the product/vendor name of your Ethernet card, you can use lspci command which displays information about PCI buses and connected PCI devices.
To install lspci on Ubuntu or Debian:
$ sudo apt-get install pciutils
To install lspci on CentOS, Fedora or RedHat:
$ sudo yum install pciutils
To find the name of Ethernet card(s) available on your system, run the following.
$ lspci | grep -i 'ethernet'
03:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
This website is made possible by minimal ads and your gracious donation via PayPal or credit card
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.
Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean