How To Determine Which Network Interface Belongs To Which PCIe Device

How To Determine Which Network Interface Belongs To Which PCIe Device

If you have physical access to the system, you can identify with 'ethtool -i' which will blink the NIC. How the NIC blinks depends on the model. The Mellanox cards have an orange light on the PCB that will blink.

~$ ethtool -p enp33s0


If you are remote, you can try to figure it out from the device number. This method involves getting the device number from ethtool and locating that device number in lspci


1.) Run ethtool -i against the interface to find the device number from the bus-info field.



~$ ethtool -i enp33s0
driver: mlx5_core
version: 3.0-1 (January 2015)
firmware-version: 12.22.1002
expansion-rom-version:
bus-info: 0000:21:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes

2.) Use lspci to locate the device by device number.


~$ lspci -v|grep '21:'
21:00.0 Ethernet controller: Mellanox Technologies MT27700 Family [ConnectX-4]


You can do this process in reverse as well.


Here is a one-liner to get all the interfaces and run ethtool -i against them in a loop

  1. for i in `ip link show| grep -v link| grep -v 'lo:'| awk {'print $2'}| sed 's/://'`; do echo $i; ethtool -i $i; echo "#####" ;done




    • Related Articles

    • Changing NIC failover mode

      Log into the IPMI web interface by entering the IP address into the URL of a web browser on a client system. Go to Configuration > Network, and scroll down to the drop-down list for LAN Interface, or Default Interfaces. The default setting is Fail ...
    • Updating MAC Addresses (CentOS/RHEL)

      If your system's motherboard has recently been replaced, you may encounter network failures due to the new motherboard using different MAC addresses. Modern Linux distributions such as CentOS and Red Hat will typically auto-populate udev rules and ...
    • Physical port layout

      Q: Which physical network port does IPMI operate over? A: IPMI will function over one of two ports on the motherboard integrated NIC, and utilizes a failover option to determine which interface it will use. The first port is the dedicated IPMI port, ...
    • Routing Multiple Nic's within the same subnet

      You may find that when working with multiple Ethernet cards within the same subnet that outgoing traffic may default to only one Nic. This is due to the routing table that Linux uses by default and while this works in most cases, you may want to ...
    • Flashing the ipmi firmware on a supermicro x9drw-if

      “Compliments of Michael J. Smalley, Smalley Creative Blog, a regularly updated source of tutorials, news, and solutions of a technical nature.” I recently tasked myself with bringing IPMI up to date on a Supermicro X9DRW-iF server. This can be quite ...