Lazy find Linux interface from PCI ID
It is sometimes hard to find which PCI ID corresponds to which NIC in Linux.
This script shows the mapping between PCI IDs and NICs.
Tested On Ubuntu 18.04.
#!/bin/bash grep PCI_SLOT_NAME /sys/class/net/*/device/uevent # will show something like # /sys/class/net/rename5/device/uevent:PCI_SLOT_NAME=0001:00:02.0 # /sys/class/net/rename6/device/uevent:PCI_SLOT_NAME=0002:00:02.0 # /sys/class/net/rename7/device/uevent:PCI_SLOT_NAME=0003:00:02.0
That's all, folks!
Tweet