Best way to find what NIC in Linux

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

KioskAdmin

Active Member
Jan 20, 2015
156
32
28
53
We just inherited a machine with 16 network interfaces using dual/ quad port cards.

It is a total pain to do ip a to find which NIC is which. Like we have mellanox cards with 2 ports each. How do I know which port is which and which is a mellanox instead of an Intel.

Method right now: using MAC address lookups I can figure out the vendor. 00:02:c9 = mellanox. Then there are two ports on the card so it's a pain.

Someone HAS to have a better option for this.
 

Rami Rosen

New Member
Sep 17, 2016
5
0
1
42
Hi,
You can run:
ethtool -i interfaceName
The first line is driver: and it gives you the name of the driver.

So for example,
ethtool -i eth0
driver: ixgbe
.....
is an Intel driver.
The same is for
ethtool -i eth1
driver: ixgbe

You can further get more info about the device by:

ethtool -i interfaceName | grep bus-info
and then, with the returned result, (let;s say it is 0000:04:00.1) run:

lspci -nvvvs 0000:04:00.1

You can also make the led blink (this is supported by many nics but not all) by
ethtool -p interfaceName or ethtool -p --identify interfaceName.

Hope this helps!

Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen